From 5f7ee67e0c718f9e98b2d240016f17226c82fae1 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 11 Jan 2021 14:07:43 +0200 Subject: SMTP mailer: fix selection of the default port * libproto/mailer/smtp.c (smtp_open): Use MU_SMTPS_PORT only if MAILER_TLS_ALWAYS is required. --- libproto/mailer/smtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libproto/mailer/smtp.c b/libproto/mailer/smtp.c index d2f134db6..cb9ac0a6b 100644 --- a/libproto/mailer/smtp.c +++ b/libproto/mailer/smtp.c @@ -233,7 +233,7 @@ smtp_open (mu_mailer_t mailer, int flags) memset (&hints, 0, sizeof (hints)); hints.flags = MU_AH_DETECT_FAMILY; - hints.port = smtp_mailer->tls ? MU_SMTPS_PORT : MU_SMTP_PORT; + hints.port = smtp_mailer->tls == MAILER_TLS_ALWAYS ? MU_SMTPS_PORT : MU_SMTP_PORT; hints.protocol = IPPROTO_TCP; hints.socktype = SOCK_STREAM; rc = mu_sockaddr_from_url (&sa, mailer->url, &hints); -- cgit v1.2.1