Skip to content

Commit

Permalink
bugfix “issues/2” - using smtp server with authentication always thro…
Browse files Browse the repository at this point in the history
…ws "wrong host name" error. (#3)

* bugfix “issues/2” - using smtp server with authentication always throws "wrong host name" error.

* Update main.go

Co-authored-by: Hasnat <[email protected]>
  • Loading branch information
doubleaxe and hasnat authored Nov 30, 2020
1 parent 456c378 commit 7c93bbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func sendNotificationViaSmtp(notificatonUrl *url.URL, message string, verifyTls
var auth = smtp.Auth(nil)
password, passSet := notificatonUrl.User.Password()
if passSet != false {
auth = smtp.PlainAuth("", notificatonUrl.User.Username(), password, notificatonUrl.Host)
auth = smtp.PlainAuth("", notificatonUrl.User.Username(), password, notificatonUrl.Hostname())
}

smtpQueryString := notificatonUrl.Query()
Expand Down Expand Up @@ -236,4 +236,4 @@ func main() {
CheckAndNotify(string(MustByteArray(reader.ReadBytes('\n'))))
}
rlog.Warnf("Fin - %v", time.Now())
}
}

0 comments on commit 7c93bbd

Please sign in to comment.