Add support for SMTP servers with StartTLS
Этот коммит содержится в:
@@ -73,7 +73,8 @@
|
|||||||
"SMTPUsername": "",
|
"SMTPUsername": "",
|
||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "",
|
"SMTPServer": "",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
|
"UseStartTLS": false,
|
||||||
"FeedbackEmail": "",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "",
|
"SMTPServer": "",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
|
"UseStartTLS": false,
|
||||||
"FeedbackEmail": "",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "",
|
"SMTPServer": "",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
|
"UseStartTLS": false,
|
||||||
"FeedbackEmail": "",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "",
|
"SMTPServer": "",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
|
"UseStartTLS": false,
|
||||||
"FeedbackEmail": "",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ type EmailSettings struct {
|
|||||||
SMTPPassword string
|
SMTPPassword string
|
||||||
SMTPServer string
|
SMTPServer string
|
||||||
UseTLS bool
|
UseTLS bool
|
||||||
|
UseStartTLS bool
|
||||||
FeedbackEmail string
|
FeedbackEmail string
|
||||||
FeedbackName string
|
FeedbackName string
|
||||||
ApplePushServer string
|
ApplePushServer string
|
||||||
|
|||||||
@@ -73,6 +73,12 @@ func newSMTPClient(conn net.Conn) (*smtp.Client, *model.AppError) {
|
|||||||
if err = c.Auth(auth); err != nil {
|
if err = c.Auth(auth); err != nil {
|
||||||
return nil, model.NewAppError("SendMail", "Failed to authenticate on SMTP server", err.Error())
|
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
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user