notifiers/email: Respect SSL option in Test

pull/180/head
Stanislav German-Evtushenko 2019-04-19 12:14:48 +09:00
parent 0826f16f3d
commit f26e0bd044
1 changed files with 5 additions and 3 deletions

View File

@ -232,10 +232,12 @@ func (u *email) OnTest() error {
if err != nil { if err != nil {
return err return err
} }
if u.ApiKey != "true" {
err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true}) err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true})
if err != nil { if err != nil {
return err return err
} }
}
if u.Username != "" || u.Password != "" { if u.Username != "" || u.Password != "" {
auth := smtp.PlainAuth("", u.Username, u.Password, host) auth := smtp.PlainAuth("", u.Username, u.Password, host)
err = dial.Auth(auth) err = dial.Auth(auth)