fix smtp should use implicit tls on 465 insteadof starttls

Signed-off-by: RonniSkansing <rskansing@gmail.com>
This commit is contained in:
RonniSkansing committed 2026-09-26 20:53:54 +02:00
1 parent ab470f8691
commit 256913b923
3 files changed
+31

No files matched your search

+13
View File
@@ -3112,6 +3112,12 @@ func (c *Campaign) sendCampaignMessages(
},
),
}
// port 465 speaks implicit TLS (SMTPS): the connection is wrapped in
// TLS on connect instead of being upgraded later via STARTTLS. go-mail
// ignores the TLS policy while SSL is on.
if smtpPort.Int() == 465 {
emailOptions = append(emailOptions, mail.WithSSL())
}
// use a custom HELO/EHLO hostname when set, otherwise go-mail
// falls back to the machine hostname
if helo, err := smtpConfig.Helo.Get(); err == nil {
@@ -5563,6 +5569,13 @@ func (c *Campaign) sendSingleEmailSMTP(
),
}
// port 465 speaks implicit TLS (SMTPS): the connection is wrapped in
// TLS on connect instead of being upgraded later via STARTTLS. go-mail
// ignores the TLS policy while SSL is on.
if smtpPort.Int() == 465 {
emailOptions = append(emailOptions, mail.WithSSL())
}
// use a custom HELO/EHLO hostname when set, otherwise go-mail
// falls back to the machine hostname
if helo, err := smtpConfig.Helo.Get(); err == nil {
+6
View File
@@ -532,6 +532,12 @@ func (m *Email) SendTestEmail(
},
),
}
// port 465 speaks implicit TLS (SMTPS): the connection is wrapped in
// TLS on connect instead of being upgraded later via STARTTLS. go-mail
// ignores the TLS policy while SSL is on.
if smtpPort.Int() == 465 {
emailOptions = append(emailOptions, mail.WithSSL())
}
// use a custom HELO/EHLO hostname when set, otherwise go-mail
// falls back to the machine hostname
if helo, err := smtp.Helo.Get(); err == nil {
+12
View File
@@ -244,6 +244,12 @@ func (s *SMTPConfiguration) SendTestEmail(
},
),
}
// port 465 speaks implicit TLS (SMTPS): the connection is wrapped in
// TLS on connect instead of being upgraded later via STARTTLS. go-mail
// ignores the TLS policy while SSL is on.
if smtpPort.Int() == 465 {
emailOptions = append(emailOptions, mail.WithSSL())
}
// use a custom HELO/EHLO hostname when set, otherwise go-mail
// falls back to the machine hostname
if helo, err := smtpConfig.Helo.Get(); err == nil {
@@ -668,6 +674,12 @@ func (s *SMTPConfiguration) SendMessages(
},
),
}
// port 465 speaks implicit TLS (SMTPS): the connection is wrapped in
// TLS on connect instead of being upgraded later via STARTTLS. go-mail
// ignores the TLS policy while SSL is on.
if smtpPort.Int() == 465 {
emailOptions = append(emailOptions, mail.WithSSL())
}
// use a custom HELO/EHLO hostname when set, otherwise go-mail
// falls back to the machine hostname
if helo, err := smtpConfig.Helo.Get(); err == nil {