Merge pull request #1952 from RincewindsHat/check_smtp_restore_tls_behaviour

check_smtp: Restore behaviour pre ead5526efa4f713e8001baed409067b0474…
This commit is contained in:
Lorenz Kästle 2023-10-21 11:40:37 +02:00 committed by GitHub
commit 2eea6bb2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -480,6 +480,8 @@ process_arguments (int argc, char **argv)
int c;
char* temp;
bool implicit_tls = false;
enum {
SNI_OPTION
};
@ -650,6 +652,8 @@ process_arguments (int argc, char **argv)
#else
usage (_("SSL support not available - install OpenSSL and recompile"));
#endif
implicit_tls = true;
// fallthrough
case 's':
/* ssl */
use_ssl = true;
@ -717,7 +721,12 @@ process_arguments (int argc, char **argv)
from_arg = strdup(" ");
if (use_starttls && use_ssl) {
usage4 (_("Set either -s/--ssl/--tls or -S/--starttls"));
if (implicit_tls) {
use_ssl = false;
server_port = SMTP_PORT;
} else {
usage4 (_("Set either -s/--ssl/--tls or -S/--starttls"));
}
}
if (server_port_option != 0) {