diff --git a/message/authresults.go b/message/authresults.go index e3443e233d..462aa2d2d8 100644 --- a/message/authresults.go +++ b/message/authresults.go @@ -424,6 +424,8 @@ func (p *parser) xresinfo(methodKeyword string) (am AuthMethod) { am.Method, am.Version, am.Result = p.xmethodspec(methodKeyword) p.cfws() if p.take("reason") { + p.cfws() + p.xtake("=") p.cfws() am.Reason = p.xvalue() } diff --git a/message/authresults_test.go b/message/authresults_test.go index ecab540f87..69251cefc5 100644 --- a/message/authresults_test.go +++ b/message/authresults_test.go @@ -311,6 +311,22 @@ func TestAuthResultsParse(t *testing.T) { }, }) + const dkimReason = `host.example; + dkim=none reason="no dkim signatures" +` + ar, err = ParseAuthResults(dkimReason) + tcheck(t, err, "parsing auth results header") + tcompare(t, ar, AuthResults{ + Hostname: "host.example", + Methods: []AuthMethod{ + { + Method: "dkim", + Result: "none", + Reason: "no dkim signatures", + }, + }, + }) + // Outlook adds an invalid line, missing required hostname at the start. And their // dmarc "action=none" is invalid. Nothing to be done. const outlook = `x; spf=pass (sender IP is 84.22.96.237)