summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5313d0d)
raw | patch | inline | side by side (parent: 5313d0d)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Mon, 10 Jun 2002 03:24:06 +0000 (03:24 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Mon, 10 Jun 2002 03:24:06 +0000 (03:24 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@49 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_smtp.c | patch | blob | history |
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index d57b7841d0f7a54e4fdc1ed7af2fb1337dd065a2..2c03874b1f332020e96f6abb42e2ba9d4eac4708 100644 (file)
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
#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"
int process_arguments (int, char **);
}
/* 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);
}