From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/401743-check_smtp.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 web/attachments/401743-check_smtp.patch (limited to 'web/attachments/401743-check_smtp.patch') diff --git a/web/attachments/401743-check_smtp.patch b/web/attachments/401743-check_smtp.patch new file mode 100644 index 0000000..bf9811e --- /dev/null +++ b/web/attachments/401743-check_smtp.patch @@ -0,0 +1,31 @@ +diff -ru nagios-plugins-1.4.15/plugins/check_smtp.c mine/plugins/check_smtp.c +--- nagios-plugins-1.4.15/plugins/check_smtp.c 2010-07-27 21:47:16.000000000 +0100 ++++ mine/plugins/check_smtp.c 2011-02-03 16:17:29.000000000 +0000 +@@ -190,14 +190,19 @@ + printf ("%s", buffer); + /* strip the buffer of carriage returns */ + strip (buffer); +- /* make sure we find the response we are looking for */ +- if (!strstr (buffer, server_expect)) { +- if (server_port == SMTP_PORT) +- printf (_("Invalid SMTP response received from host: %s\n"), buffer); +- else +- printf (_("Invalid SMTP response received from host on port %d: %s\n"), +- server_port, buffer); +- result = STATE_WARNING; ++ /* make sure we got a valid connect response */ ++ if (!strstr (buffer, "220")) { ++ /* make sure we find the response we are looking for */ ++ if (!strstr (buffer, server_expect)) { ++ if (server_port == SMTP_PORT) ++ printf (_("Invalid SMTP response received from host: %s\n"), buffer); ++ else ++ printf (_("Invalid SMTP response received from host on port %d: %s\n"), ++ server_port, buffer); ++ result = STATE_WARNING; ++ } ++ /* Failed to connect, so bail */ ++ return result; + } + } + -- cgit v1.2.3-74-g34f1