Merge pull request #180 from giner/email_test_respect_ssl_option

notifiers/email: Respect SSL option in Test
pull/168/head^2
Hunter Long 2019-04-19 20:46:22 -07:00 committed by GitHub
commit 1060e3c698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -232,10 +232,12 @@ func (u *email) OnTest() error {
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)
err = dial.Auth(auth)