diff --git a/changelog.d/38.bugfix b/changelog.d/38.bugfix new file mode 100644 index 0000000..08dc145 --- /dev/null +++ b/changelog.d/38.bugfix @@ -0,0 +1 @@ +Fix email support to support authenticated mail with a custom port. diff --git a/submit.go b/submit.go index 799dea9..3b0b093 100644 --- a/submit.go +++ b/submit.go @@ -27,6 +27,7 @@ import ( "log" "mime" "mime/multipart" + "net" "net/http" "net/smtp" "os" @@ -664,7 +665,8 @@ func (s *submitServer) sendEmail(p parsedPayload, reportDir string) error { var auth smtp.Auth = nil if s.cfg.SMTPPassword != "" || s.cfg.SMTPUsername != "" { - auth = smtp.PlainAuth("", s.cfg.SMTPUsername, s.cfg.SMTPPassword, s.cfg.SMTPServer) + host, _, _ := net.SplitHostPort(s.cfg.SMTPServer) + auth = smtp.PlainAuth("", s.cfg.SMTPUsername, s.cfg.SMTPPassword, host) } err := e.Send(s.cfg.SMTPServer, auth) if err != nil {