ares_parse: handle ADMD-less Authentication-Results headers (closes #73)#372
Merged
thegushi merged 4 commits intoMay 26, 2026
Merged
Conversation
…d working on musl by orlitzky)
…system section
Office 365 generates Authentication-Results headers that omit the authserv-id (ADMD), jumping straight to method=result tokens. This is non-compliant with RFC 8601 but common enough in practice that the hard parse failure causes log noise and, downstream, can cause OpenDMARC to report authentication failures for otherwise valid mail. When state 1 encounters '=' instead of ';' or a version digit, the accumulated host token is actually a method name. Recover by leaving ares_host empty and continuing from the result value. ares_host will be empty, signalling no authserv-id was present. Closes trusteddomainproject#73
Merged
3 tasks
This was referenced May 26, 2026
thegushi
added a commit
to thegushi/OpenDKIM
that referenced
this pull request
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Office 365 generates
Authentication-Resultsheaders that omit the authserv-id (ADMD), jumping straight tomethod=resulttokens:RFC 8601 requires the authserv-id before the semicolon, so these are technically non-compliant. However they are common enough in practice that the current hard parse failure has real consequences: log noise on every O365-originated message, and downstream propagation to OpenDMARC which can interpret the unparsed header as an authentication failure.
Fix
In state 1 of
ares_parse(), when=is seen instead of;or a version digit, the token we read as authserv-id is actually the first method name. The fix recovers gracefully:ares_hostis left empty (signalling no authserv-id present), the token is slotted as the method, and parsing continues from the result value.The same fix has been applied to OpenDMARC (see trusteddomainproject/OpenDMARC#329) and should be applied to OpenARC as well.
Test plan
Authentication-Results: spf=pass smtp.mailfrom=example.comparses without error,ares_hostis empty, method isspf, result ispassAuthentication-Results: compauth=pass reason=000parses without error, method isunknownmake checkpasses