Skip to content

Commit

Permalink
Add support for no-auth SMTPs
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Feb 5, 2020
1 parent 1064f1e commit 047de69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.toml.sample
Expand Up @@ -79,7 +79,7 @@ max_idle = 10
host = "my.smtp.server"
port = "25"

# cram or plain.
# cram | plain | empty for no auth
auth_protocol = "cram"
username = "xxxxx"
password = ""
Expand Down
2 changes: 1 addition & 1 deletion messenger/emailer.go
Expand Up @@ -43,7 +43,7 @@ func NewEmailer(srv ...Server) (Messenger, error) {
var auth smtp.Auth
if s.AuthProtocol == "cram" {
auth = smtp.CRAMMD5Auth(s.Username, s.Password)
} else {
} else if s.AuthProtocol == "plain" {
auth = smtp.PlainAuth("", s.Username, s.Password, s.Host)
}

Expand Down

0 comments on commit 047de69

Please sign in to comment.