summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2021-01-11 12:07:43 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2021-01-11 12:07:43 (GMT)
commit5f7ee67e0c718f9e98b2d240016f17226c82fae1 (patch) (side-by-side diff)
treef0c0ab04d5a0ee3c7c419e10524b6066b66043d2
parent51ffe23a906052d1ad5ba7100415da7df73f4152 (diff)
downloadmailutils-5f7ee67e0c718f9e98b2d240016f17226c82fae1.tar.gz
mailutils-5f7ee67e0c718f9e98b2d240016f17226c82fae1.tar.bz2
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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libproto/mailer/smtp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libproto/mailer/smtp.c b/libproto/mailer/smtp.c
index d2f134d..cb9ac0a 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);

Return to:

Send suggestions and report system problems to the System administrator.