summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2023-10-21 11:40:37 +0200
committerGitHub <noreply@github.com>2023-10-21 11:40:37 +0200
commit2eea6bb2a04bbfb169bac5f0f7c319f998e8ab87 (patch)
treeb0bba22f048a00a18c074bcb03f4a69932035632
parent47cb10013e6935bb6cdf470925ea5a5f74464646 (diff)
parentdecca6d290fb56adc0ef21525f14ea138aca6d45 (diff)
downloadmonitoring-plugins-2eea6bb.tar.gz
Merge pull request #1952 from RincewindsHat/check_smtp_restore_tls_behaviour
check_smtp: Restore behaviour pre ead5526efa4f713e8001baed409067b0474…
-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) {