summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSubhendu Ghosh <sghosh@users.sourceforge.net>2002-06-10 03:24:06 +0000
committerSubhendu Ghosh <sghosh@users.sourceforge.net>2002-06-10 03:24:06 +0000
commit2d61d4b43eb58662474e8aff51d6d8e8a780a751 (patch)
treec0b460ed952ea4f1769a4fe211914bab03b3e4d8 /plugins
parent5313d0d60331cc5136bf097c75556039ca27f4c4 (diff)
downloadmonitoring-plugins-2d61d4b43eb58662474e8aff51d6d8e8a780a751.tar.gz
patch to stop NOQUEUE syslog messages - Karl Ewald
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@49 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_smtp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index d57b7841..2c03874b 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -43,6 +43,13 @@
43 43
44#define SMTP_PORT 25 44#define SMTP_PORT 25
45#define SMTP_EXPECT "220" 45#define SMTP_EXPECT "220"
46/* sendmail will syslog a "NOQUEUE" error if session does not attempt
47 * to do something useful. This can be prevented by giving a command
48 * even if syntax is illegal (MAIL requires a FROM:<...> argument)
49 * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD.
50 */
51#define SMTP_DUMMYCMD "MAIL\n"
52#define SMTP_USE_DUMMYCMD 1
46#define SMTP_QUIT "QUIT\n" 53#define SMTP_QUIT "QUIT\n"
47 54
48int process_arguments (int, char **); 55int process_arguments (int, char **);
@@ -131,6 +138,12 @@ main (int argc, char **argv)
131 } 138 }
132 139
133 /* close the connection */ 140 /* close the connection */
141#ifdef SMTP_USE_DUMMYCMD
142 send(sd,SMTP_DUMMYCMD,strlen(SMTP_DUMMYCMD),0);
143 /* allow for response to DUMMYCMD to reach us */
144 recv(sd,buffer,MAX_INPUT_BUFFER-1,0);
145#endif /* SMTP_USE_DUMMYCMD */
146
134 send (sd, SMTP_QUIT, strlen (SMTP_QUIT), 0); 147 send (sd, SMTP_QUIT, strlen (SMTP_QUIT), 0);
135 close (sd); 148 close (sd);
136 } 149 }