[Nagiosplug-checkins] nagiosplug/plugins check_smtp.c,1.45,1.46

M. Sean Finney seanius at users.sourceforge.net
Thu Apr 7 00:06:07 CEST 2005


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16589

Modified Files:
	check_smtp.c 
Log Message:
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


Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- check_smtp.c	4 Apr 2005 18:24:12 -0000	1.45
+++ check_smtp.c	7 Apr 2005 04:33:33 -0000	1.46
@@ -177,6 +177,13 @@
 				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
 		if(use_ssl) {
 		  /* send the STARTTLS command */
@@ -206,16 +213,6 @@
 		  }
 		}
 #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
 		 * to do something useful. This can be prevented by giving a command





More information about the Commits mailing list