mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-21 14:19:30 -04:00
check_smtp: Abort on missing/unexpected greeting
Abort immediately if we don't receive a server greeting or if the greeting doesn't contain the "--expect"ed string (by default: "220") instead of blindly sending the EHLO/HELO line. Spotted by Daniel Piddock, see Debian bug report #611914.
This commit is contained in:
parent
4611e41bc5
commit
d16f3fb0a9
1 changed files with 2 additions and 2 deletions
|
|
@ -183,7 +183,7 @@ main (int argc, char **argv)
|
|||
/* return a WARNING status if we couldn't read any data */
|
||||
if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
|
||||
printf (_("recv() failed\n"));
|
||||
result = STATE_WARNING;
|
||||
return STATE_WARNING;
|
||||
}
|
||||
else {
|
||||
if (verbose)
|
||||
|
|
@ -197,7 +197,7 @@ main (int argc, char **argv)
|
|||
else
|
||||
printf (_("Invalid SMTP response received from host on port %d: %s\n"),
|
||||
server_port, buffer);
|
||||
result = STATE_WARNING;
|
||||
return STATE_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue