From a82cef7065f2f6ccca9e037b1271e9bbe0c04fd0 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 28 Aug 2020 23:25:32 +0200 Subject: [PATCH] Set gomail.Dialer LocalName --- internal/config/config_test.go | 3 ++- internal/notif/mail/client.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 3fa7aa4a..4badcfc1 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -362,6 +362,7 @@ func TestLoadMixed(t *testing.T) { "DIUN_NOTIF_MAIL_INSECURESKIPVERIFY=true", "DIUN_NOTIF_MAIL_FROM=diun@foo.com", "DIUN_NOTIF_MAIL_TO=webmaster@foo.com", + "DIUN_NOTIF_MAIL_LOCALNAME=foo.com", }, expected: &config.Config{ Db: (&model.Db{}).GetDefaults(), @@ -372,7 +373,7 @@ func TestLoadMixed(t *testing.T) { Port: 25, SSL: utl.NewFalse(), InsecureSkipVerify: utl.NewTrue(), - LocalName: "localhost", + LocalName: "foo.com", From: "diun@foo.com", To: "webmaster@foo.com", }, diff --git a/internal/notif/mail/client.go b/internal/notif/mail/client.go index f0445b56..cb57889d 100644 --- a/internal/notif/mail/client.go +++ b/internal/notif/mail/client.go @@ -135,6 +135,7 @@ Need help, or have questions? Go to https://github.com/crazy-max/diun and leave Password: password, SSL: *c.cfg.SSL, TLSConfig: tlsConfig, + LocalName: c.cfg.LocalName, } return dialer.DialAndSend(msg)