summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/config.go1
-rw-r--r--utils/mail.go6
2 files changed, 7 insertions, 0 deletions
diff --git a/utils/config.go b/utils/config.go
index a3944f670..536d0d802 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -85,6 +85,7 @@ type EmailSettings struct {
SMTPPassword string
SMTPServer string
UseTLS bool
+ UseStartTLS bool
FeedbackEmail string
FeedbackName string
ApplePushServer string
diff --git a/utils/mail.go b/utils/mail.go
index d152b2669..f02e21253 100644
--- a/utils/mail.go
+++ b/utils/mail.go
@@ -73,6 +73,12 @@ func newSMTPClient(conn net.Conn) (*smtp.Client, *model.AppError) {
if err = c.Auth(auth); err != nil {
return nil, model.NewAppError("SendMail", "Failed to authenticate on SMTP server", err.Error())
}
+ } else if Cfg.EmailSettings.UseStartTLS {
+ tlsconfig := &tls.Config{
+ InsecureSkipVerify: true,
+ ServerName: host,
+ }
+ c.StartTLS(tlsconfig)
}
return c, nil
}