diff options
Diffstat (limited to 'web/attachments/417469-check_smtp.c.patch')
| -rw-r--r-- | web/attachments/417469-check_smtp.c.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/web/attachments/417469-check_smtp.c.patch b/web/attachments/417469-check_smtp.c.patch new file mode 100644 index 0000000..3c6a812 --- /dev/null +++ b/web/attachments/417469-check_smtp.c.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c | ||
| 2 | index ed49163..80cc0eb 100644 | ||
| 3 | --- a/plugins/check_smtp.c | ||
| 4 | +++ b/plugins/check_smtp.c | ||
| 5 | @@ -129,6 +129,9 @@ main (int argc, char **argv) | ||
| 6 | char *error_msg = ""; | ||
| 7 | struct timeval tv; | ||
| 8 | |||
| 9 | + /* catch pipe errors in read.write */ | ||
| 10 | + (void) signal (SIGPIPE, SIG_IGN); | ||
| 11 | + | ||
| 12 | setlocale (LC_ALL, ""); | ||
| 13 | bindtextdomain (PACKAGE, LOCALEDIR); | ||
| 14 | textdomain (PACKAGE); | ||
| 15 | @@ -662,8 +665,20 @@ void | ||
| 16 | smtp_quit(void) | ||
| 17 | { | ||
| 18 | int bytes; | ||
| 19 | + int n; | ||
| 20 | + | ||
| 21 | + n = my_send(SMTP_QUIT, strlen(SMTP_QUIT)); | ||
| 22 | + if(n != 0) { | ||
| 23 | + if(verbose) { | ||
| 24 | + /* Not sure this is really an unknown state so just print out instead | ||
| 25 | + die (STATE_UNKNOWN, | ||
| 26 | + */ | ||
| 27 | + printf( | ||
| 28 | + _("Connection was closed by server before we could send QUIT command\n")); | ||
| 29 | + } | ||
| 30 | + return; | ||
| 31 | + } | ||
| 32 | |||
| 33 | - my_send(SMTP_QUIT, strlen(SMTP_QUIT)); | ||
| 34 | if (verbose) | ||
| 35 | printf(_("sent %s\n"), "QUIT"); | ||
| 36 | |||
