fix: send the bare address as SMTP envelope sender so mailcow DKIM-signs
This commit is contained in:
+16
-1
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user