diff options
Diffstat (limited to 'web/attachments/401743-check_smtp.patch')
| -rw-r--r-- | web/attachments/401743-check_smtp.patch | 31 |
1 files changed, 31 insertions, 0 deletions
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 @@ | |||
| 1 | diff -ru nagios-plugins-1.4.15/plugins/check_smtp.c mine/plugins/check_smtp.c | ||
| 2 | --- nagios-plugins-1.4.15/plugins/check_smtp.c 2010-07-27 21:47:16.000000000 +0100 | ||
| 3 | +++ mine/plugins/check_smtp.c 2011-02-03 16:17:29.000000000 +0000 | ||
| 4 | @@ -190,14 +190,19 @@ | ||
| 5 | printf ("%s", buffer); | ||
| 6 | /* strip the buffer of carriage returns */ | ||
| 7 | strip (buffer); | ||
| 8 | - /* make sure we find the response we are looking for */ | ||
| 9 | - if (!strstr (buffer, server_expect)) { | ||
| 10 | - if (server_port == SMTP_PORT) | ||
| 11 | - printf (_("Invalid SMTP response received from host: %s\n"), buffer); | ||
| 12 | - else | ||
| 13 | - printf (_("Invalid SMTP response received from host on port %d: %s\n"), | ||
| 14 | - server_port, buffer); | ||
| 15 | - result = STATE_WARNING; | ||
| 16 | + /* make sure we got a valid connect response */ | ||
| 17 | + if (!strstr (buffer, "220")) { | ||
| 18 | + /* make sure we find the response we are looking for */ | ||
| 19 | + if (!strstr (buffer, server_expect)) { | ||
| 20 | + if (server_port == SMTP_PORT) | ||
| 21 | + printf (_("Invalid SMTP response received from host: %s\n"), buffer); | ||
| 22 | + else | ||
| 23 | + printf (_("Invalid SMTP response received from host on port %d: %s\n"), | ||
| 24 | + server_port, buffer); | ||
| 25 | + result = STATE_WARNING; | ||
| 26 | + } | ||
| 27 | + /* Failed to connect, so bail */ | ||
| 28 | + return result; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
