summaryrefslogtreecommitdiffstats
path: root/modules/mailer/mailer.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mailer/mailer.go')
-rw-r--r--modules/mailer/mailer.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index a54e836173..e9b752e14d 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -122,11 +122,10 @@ func (s *smtpSender) Send(from string, to []string, msg io.WriterTo) error {
}
defer conn.Close()
- isSecureConn := false
+ isSecureConn := opts.IsTLSEnabled || (strings.HasSuffix(port, "465"))
// Start TLS directly if the port ends with 465 (SMTPS protocol)
- if strings.HasSuffix(port, "465") {
+ if isSecureConn {
conn = tls.Client(conn, tlsconfig)
- isSecureConn = true
}
client, err := smtp.NewClient(conn, host)