diff options
author | 2024-06-22 23:36:30 +0200 | |
---|---|---|
committer | 2024-06-22 23:36:30 +0200 | |
commit | c2738474d5f4bcdd83bdc09c372f27fe677201ab (patch) | |
tree | 1df6cc7f8882774274cb72c90a34ea3febc42448 /internal/email/noopsender.go | |
parent | [chore] update github.com/ncruces/go-sqlite3 -> v0.16.3 (#3029) (diff) | |
download | gotosocial-c2738474d5f4bcdd83bdc09c372f27fe677201ab.tar.xz |
[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
Diffstat (limited to 'internal/email/noopsender.go')
-rw-r--r-- | internal/email/noopsender.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/email/noopsender.go b/internal/email/noopsender.go index 20d7df2eb..bd9b1206e 100644 --- a/internal/email/noopsender.go +++ b/internal/email/noopsender.go @@ -31,6 +31,7 @@ import ( // Passing a nil function is also acceptable, in which case the send functions will just return nil. func NewNoopSender(sendCallback func(toAddress string, message string)) (Sender, error) { templateBaseDir := config.GetWebTemplateBaseDir() + msgIDHost := config.GetHost() t, err := loadTemplates(templateBaseDir) if err != nil { @@ -39,12 +40,14 @@ func NewNoopSender(sendCallback func(toAddress string, message string)) (Sender, return &noopSender{ sendCallback: sendCallback, + msgIDHost: msgIDHost, template: t, }, nil } type noopSender struct { sendCallback func(toAddress string, message string) + msgIDHost string template *template.Template } @@ -86,7 +89,7 @@ func (s *noopSender) sendTemplate(template string, subject string, data any, toA return err } - msg, err := assembleMessage(subject, buf.String(), "test@example.org", toAddresses...) + msg, err := assembleMessage(subject, buf.String(), "test@example.org", s.msgIDHost, toAddresses...) if err != nil { return err } |