We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0924f42 commit e0e045aCopy full SHA for e0e045a
services/auth/source/smtp/auth.go
@@ -65,8 +65,7 @@ func Authenticate(a smtp.Auth, source *Source) error {
65
}
66
defer conn.Close()
67
68
- isSecureConn := source.ForceSMTPS || source.Port == 465
69
- if isSecureConn {
+ if source.UseTLS() {
70
conn = tls.Client(conn, tlsConfig)
71
72
@@ -92,7 +91,7 @@ func Authenticate(a smtp.Auth, source *Source) error {
92
91
93
// If not using SMTPS, always use STARTTLS if available
94
hasStartTLS, _ := client.Extension("STARTTLS")
95
- if !isSecureConn && hasStartTLS {
+ if !source.UseTLS() && hasStartTLS {
96
if err = client.StartTLS(tlsConfig); err != nil {
97
return fmt.Errorf("failed to start StartTLS: %v", err)
98
0 commit comments