1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-01 11:09:30 +02:00

Allow SMTP servers without auth

This commit is contained in:
binwiederhier 2023-03-02 20:25:13 -05:00
parent 64b3c3c2fa
commit 90db1283dd
5 changed files with 19 additions and 9 deletions

View file

@ -36,7 +36,10 @@ func (s *smtpSender) Send(v *visitor, m *message, to string) error {
if err != nil {
return err
}
auth := smtp.PlainAuth("", s.config.SMTPSenderUser, s.config.SMTPSenderPass, host)
var auth smtp.Auth
if s.config.SMTPSenderUser != "" {
auth = smtp.PlainAuth("", s.config.SMTPSenderUser, s.config.SMTPSenderPass, host)
}
ev := logvm(v, m).
Tag(tagEmail).
Fields(log.Context{