summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2012-06-29 10:26:16 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2012-06-29 11:39:11 (GMT)
commit9976876584e5a1df6e1c9315212c3d274df7a12e (patch)
treeb71d1953146fda471713e7bf349c0315a82f990c /plugins/check_smtp.c
parentdd1e9eb5eadffa4a1519c7b67f65f5aa9c586145 (diff)
downloadmonitoring-plugins-9976876584e5a1df6e1c9315212c3d274df7a12e.tar.gz
check_smtp: Strip angle brackets from -f argument, if provided
Apparently some people used -f '<nagios@example.com>' to work around the bug I just fixed in the MAIL FROM: command generation. Although the resulting command wasn't RFC-compliant, it was working with some MTAs, so let's continue to support this syntax now that we generate RFC-compliant commands. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 56be585..77ac5ce 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -521,7 +521,8 @@ process_arguments (int argc, char **argv)
521 localhostname = strdup(optarg); 521 localhostname = strdup(optarg);
522 break; 522 break;
523 case 'f': /* from argument */ 523 case 'f': /* from argument */
524 from_arg = optarg; 524 from_arg = optarg + strspn(optarg, "<");
525 from_arg = strndup(from_arg, strcspn(from_arg, ">"));
525 smtp_use_dummycmd = 1; 526 smtp_use_dummycmd = 1;
526 break; 527 break;
527 case 'A': 528 case 'A':