summaryrefslogtreecommitdiffstats
path: root/services/mailer/mailer_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-01-22 15:23:52 +0100
committerGitHub <noreply@github.com>2023-01-22 15:23:52 +0100
commit21dd4a252a98fee4e8b4304d63685c4fae7cc077 (patch)
tree20e81cfe513753adc19c5a1902289d6925cb3aa2 /services/mailer/mailer_test.go
parentgitlab supports ssh key signing (#22564) (diff)
downloadforgejo-21dd4a252a98fee4e8b4304d63685c4fae7cc077.tar.xz
forgejo-21dd4a252a98fee4e8b4304d63685c4fae7cc077.zip
Prevent multiple `To` recipients (#22566)
Change the mailer interface to prevent leaking of possible hidden email addresses when sending to multiple recipients. Co-authored-by: Gusted <williamzijl7@hotmail.com>
Diffstat (limited to 'services/mailer/mailer_test.go')
-rw-r--r--services/mailer/mailer_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/mailer/mailer_test.go b/services/mailer/mailer_test.go
index 79c5231218..375ca35daa 100644
--- a/services/mailer/mailer_test.go
+++ b/services/mailer/mailer_test.go
@@ -21,17 +21,17 @@ func TestGenerateMessageID(t *testing.T) {
setting.Domain = "localhost"
date := time.Date(2000, 1, 2, 3, 4, 5, 6, time.UTC)
- m := NewMessageFrom(nil, "display-name", "from-address", "subject", "body")
+ m := NewMessageFrom("", "display-name", "from-address", "subject", "body")
m.Date = date
gm := m.ToMessage()
assert.Equal(t, "<autogen-946782245000-41e8fc54a8ad3a3f@localhost>", gm.GetHeader("Message-ID")[0])
- m = NewMessageFrom([]string{"a@b.com"}, "display-name", "from-address", "subject", "body")
+ m = NewMessageFrom("a@b.com", "display-name", "from-address", "subject", "body")
m.Date = date
gm = m.ToMessage()
assert.Equal(t, "<autogen-946782245000-cc88ce3cfe9bd04f@localhost>", gm.GetHeader("Message-ID")[0])
- m = NewMessageFrom([]string{"a@b.com"}, "display-name", "from-address", "subject", "body")
+ m = NewMessageFrom("a@b.com", "display-name", "from-address", "subject", "body")
m.SetHeader("Message-ID", "<msg-d@domain.com>")
gm = m.ToMessage()
assert.Equal(t, "<msg-d@domain.com>", gm.GetHeader("Message-ID")[0])