From 047de697707e4a3ea23b53c7a1917f20edc9f8c2 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 5 Feb 2020 18:09:13 +0530 Subject: [PATCH] Add support for no-auth SMTPs --- config.toml.sample | 2 +- messenger/emailer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml.sample b/config.toml.sample index 4d62299..9b29c70 100644 --- a/config.toml.sample +++ b/config.toml.sample @@ -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 = "" diff --git a/messenger/emailer.go b/messenger/emailer.go index a591c88..80df9c3 100644 --- a/messenger/emailer.go +++ b/messenger/emailer.go @@ -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) }