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,9 +232,11 @@ func (u *email) OnTest() error {
if err != nil {
return err
}
err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true})
if err != nil {
return err
if u.ApiKey != "true" {
err = dial.StartTLS(&tls.Config{InsecureSkipVerify: true})
if err != nil {
return err
}
}
if u.Username != "" || u.Password != "" {
auth := smtp.PlainAuth("", u.Username, u.Password, host)