瀏覽代碼

in honor of joining up, my first bugfix. this should resolve 1174070.

note i don't have an exchange server to test this against, but it
does what the requester mentioned (slightly cleaner than the patch
attached in the tracker).

it does, however, still work against my own postfix server :)

	sean


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1158 f882894a-f735-0410-b71e-b25c423dba1c
M. Sean Finney 21 年之前
父節點
當前提交
d6b81a5912
共有 1 個文件被更改,包括 7 次插入10 次删除
  1. 7 10
      plugins/check_smtp.c

+ 7 - 10
plugins/check_smtp.c

@@ -177,6 +177,13 @@ main (int argc, char **argv)
 				result = STATE_WARNING;
 				result = STATE_WARNING;
 			}
 			}
 		}
 		}
+
+		/* send the HELO command */
+		send(sd, helocmd, strlen(helocmd), 0);
+
+		/* allow for response to helo command to reach us */
+		read (sd, buffer, MAXBUF - 1);
+
 #ifdef HAVE_SSL
 #ifdef HAVE_SSL
 		if(use_ssl) {
 		if(use_ssl) {
 		  /* send the STARTTLS command */
 		  /* send the STARTTLS command */
@@ -206,16 +213,6 @@ main (int argc, char **argv)
 		  }
 		  }
 		}
 		}
 #endif
 #endif
-		/* send the HELO command */
-#ifdef HAVE_SSL
-		if (use_ssl)
-		  SSL_write(ssl, helocmd, strlen(helocmd));
-		else
-#endif
-		send(sd, helocmd, strlen(helocmd), 0);
-
-		/* allow for response to helo command to reach us */
-		myrecv();
 				
 				
 		/* sendmail will syslog a "NOQUEUE" error if session does not attempt
 		/* sendmail will syslog a "NOQUEUE" error if session does not attempt
 		 * to do something useful. This can be prevented by giving a command
 		 * to do something useful. This can be prevented by giving a command