From c2738474d5f4bcdd83bdc09c372f27fe677201ab Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 22 Jun 2024 23:36:30 +0200 Subject: [bugfix] add Date and Message-ID headers for email (#3031) * [bugfix] add Date and Message-ID headers for email This should make spam filters more happy, as most of them grant some negative score for not having those headers. Also the Date is convenient for the user receiving the mail. * make golangci-lint happy --- internal/email/sender.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/email/sender.go') diff --git a/internal/email/sender.go b/internal/email/sender.go index a3efa6124..9db918f8a 100644 --- a/internal/email/sender.go +++ b/internal/email/sender.go @@ -76,11 +76,13 @@ func NewSender() (Sender, error) { host := config.GetSMTPHost() port := config.GetSMTPPort() from := config.GetSMTPFrom() + msgIDHost := config.GetHost() return &sender{ hostAddress: fmt.Sprintf("%s:%d", host, port), from: from, auth: smtp.PlainAuth("", username, password, host), + msgIDHost: msgIDHost, template: t, }, nil } @@ -89,5 +91,6 @@ type sender struct { hostAddress string from string auth smtp.Auth + msgIDHost string template *template.Template } -- cgit v1.2.3