fix: send the bare address as SMTP envelope sender so mailcow DKIM-signs

This commit is contained in:
2026-09-11 11:00:40 +00:00
parent 91841174dd
commit 91d10a7650
2 changed files with 35 additions and 7 deletions
+16 -1
View File
@@ -11,9 +11,24 @@ import (
"testing"
)
// The envelope carries the bare address. "Vantage <x@y>" as MAIL FROM left
// rspamd with no envelope sender, and mailcow skipped DKIM signing.
func TestAddrSpecStripsDisplayName(t *testing.T) {
for in, want := range map[string]string{
"Vantage <support@example.com>": "support@example.com",
"support@example.com": "support@example.com",
" a@example.com ": "a@example.com",
"not an address": "not an address",
} {
if got := addrSpec(in); got != want {
t.Errorf("addrSpec(%q) = %q, want %q", in, got, want)
}
}
}
// Every part must declare quoted-printable and put only 7-bit bytes on the
// wire. Raw UTF-8 under an implied 7bit encoding scored R_BAD_CTE_7BIT in
// rspamd, went out without a DKIM signature, and landed in Gmail's spam.
// rspamd.
func TestEnvelopePartsAreQuotedPrintable(t *testing.T) {
s := Sender{From: "Vantage <support@example.com>"}
m := message{