Skip to content

Commit 6350b0d

Browse files
committed
Enforce STARTTLS for SMTP submission
1 parent d51ae9f commit 6350b0d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/homeform.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ class MailSenderThread : public QThread {
9191
#ifdef SMTP_SERVER
9292
#define _STR(x) #x
9393
#define STRINGIFY(x) _STR(x)
94-
// Use implicit TLS (SMTPS) to enforce encrypted transport from the first byte.
95-
SmtpClient smtp(STRINGIFY(SMTP_SERVER), 465, SmtpClient::SslConnection);
94+
// Use mandatory STARTTLS on submission port: connection fails if TLS upgrade is not available/successful.
95+
SmtpClient smtp(STRINGIFY(SMTP_SERVER), 587, SmtpClient::TlsConnection);
9696
#else
9797
#pragma message "stmp server is unset!"
98-
SmtpClient smtp(QLatin1String(""), 465, SmtpClient::SslConnection);
98+
SmtpClient smtp(QLatin1String(""), 25, SmtpClient::TlsConnection);
9999
delete message;
100100
return;
101101
#endif
@@ -10859,4 +10859,3 @@ extern "C" {
1085910859
}
1086010860
#endif
1086110861
// Force rebuild for Q_INVOKABLE changes
10862-

0 commit comments

Comments
 (0)