[Nagiosplug-checkins] CVS: nagiosplug/plugins check_smtp.c,1.1.1.1,1.2
Subhendu Ghosh
sghosh at users.sourceforge.net
Sun Jun 9 20:25:02 CEST 2002
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv24022
Modified Files:
check_smtp.c
Log Message:
patch to stop NOQUEUE syslog messages - Karl Ewald
Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_smtp.c 28 Feb 2002 06:42:58 -0000 1.1.1.1
--- check_smtp.c 10 Jun 2002 03:24:06 -0000 1.2
***************
*** 44,47 ****
--- 44,54 ----
#define SMTP_PORT 25
#define SMTP_EXPECT "220"
+ /* sendmail will syslog a "NOQUEUE" error if session does not attempt
+ * to do something useful. This can be prevented by giving a command
+ * even if syntax is illegal (MAIL requires a FROM:<...> argument)
+ * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD.
+ */
+ #define SMTP_DUMMYCMD "MAIL\n"
+ #define SMTP_USE_DUMMYCMD 1
#define SMTP_QUIT "QUIT\n"
***************
*** 132,135 ****
--- 139,148 ----
/* close the connection */
+ #ifdef SMTP_USE_DUMMYCMD
+ send(sd,SMTP_DUMMYCMD,strlen(SMTP_DUMMYCMD),0);
+ /* allow for response to DUMMYCMD to reach us */
+ recv(sd,buffer,MAX_INPUT_BUFFER-1,0);
+ #endif /* SMTP_USE_DUMMYCMD */
+
send (sd, SMTP_QUIT, strlen (SMTP_QUIT), 0);
close (sd);
More information about the Commits
mailing list