summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 11:31:28 +0200
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-19 11:31:28 +0200
commitdecca6d290fb56adc0ef21525f14ea138aca6d45 (patch)
treeb0bba22f048a00a18c074bcb03f4a69932035632 /plugins/check_smtp.c
parent47cb10013e6935bb6cdf470925ea5a5f74464646 (diff)
downloadmonitoring-plugins-decca6d290fb56adc0ef21525f14ea138aca6d45.tar.gz
check_smtp: Restore behaviour pre ead5526efa4f713e8001baed409067b0474cb72d regarding -D and TLS
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index d1c24666..986c3e18 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -480,6 +480,8 @@ process_arguments (int argc, char **argv)
480 int c; 480 int c;
481 char* temp; 481 char* temp;
482 482
483 bool implicit_tls = false;
484
483 enum { 485 enum {
484 SNI_OPTION 486 SNI_OPTION
485 }; 487 };
@@ -650,6 +652,8 @@ process_arguments (int argc, char **argv)
650#else 652#else
651 usage (_("SSL support not available - install OpenSSL and recompile")); 653 usage (_("SSL support not available - install OpenSSL and recompile"));
652#endif 654#endif
655 implicit_tls = true;
656 // fallthrough
653 case 's': 657 case 's':
654 /* ssl */ 658 /* ssl */
655 use_ssl = true; 659 use_ssl = true;
@@ -717,7 +721,12 @@ process_arguments (int argc, char **argv)
717 from_arg = strdup(" "); 721 from_arg = strdup(" ");
718 722
719 if (use_starttls && use_ssl) { 723 if (use_starttls && use_ssl) {
720 usage4 (_("Set either -s/--ssl/--tls or -S/--starttls")); 724 if (implicit_tls) {
725 use_ssl = false;
726 server_port = SMTP_PORT;
727 } else {
728 usage4 (_("Set either -s/--ssl/--tls or -S/--starttls"));
729 }
721 } 730 }
722 731
723 if (server_port_option != 0) { 732 if (server_port_option != 0) {