Fix authserv-id quoting and apply AuthservIDWithJobID to SPF header (issue #17)#311
Open
thegushi wants to merge 1 commit into
Open
Fix authserv-id quoting and apply AuthservIDWithJobID to SPF header (issue #17)#311thegushi wants to merge 1 commit into
thegushi wants to merge 1 commit into
Conversation
…issue trusteddomainproject#17) Two related bugs in Authentication-Results header generation: 1. The authserv-id was formatted as authservid/jobid when AuthservIDWithJobID was set, but "/" is a tspecial per RFC 2045 and not valid in an unquoted token. The correct form is "authservid/jobid" (quoted string per RFC 8601). authservid_hdr is now built once with proper quoting and used in all three A-R header sites (spf=, dmarc=, and the permerror path). Bare authservids (no job ID) are valid RFC 2045 tokens and are left unquoted. 2. The spf= A-R header emitted by SPFSelfValidate ignored AuthservIDWithJobID entirely, using bare authservid while the dmarc= header used authservid/jobid. Both headers now use authservid_hdr consistently. Separate spf= and dmarc= headers are preserved for downstream compatibility. Adds t-verify-authservid-jobid to verify RFC-compliant quoting in all emitted Authentication-Results headers when AuthservIDWithJobID is set. Credit to @dilyanpalauzov for identifying the AuthservIDWithJobID inconsistency.
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.
Fixes #17.
Two related bugs in Authentication-Results header generation:
1. Invalid authserv-id format when
AuthservIDWithJobIDis setThe authserv-id was formatted as
authservid/jobid, but/is a tspecial per RFC 2045 and not valid in an unquoted token. The correct form is"authservid/jobid"(a quoted string per RFC 8601).authservid_hdris now built once with proper quoting and used consistently in all three A-R header sites (spf=,dmarc=, and the permerror path). Bare authservids without a job ID are valid RFC 2045 tokens and are left unquoted.2.
AuthservIDWithJobIDignored forspf=headerThe
spf=A-R header emitted bySPFSelfValidateused bareauthservidregardless of theAuthservIDWithJobIDsetting, while thedmarc=header honoured it. Both headers now useauthservid_hdrconsistently.Separate
spf=anddmarc=headers are preserved for downstream compatibility.Adds
t-verify-authservid-jobidto verify RFC-compliant quoting across all emitted Authentication-Results headers whenAuthservIDWithJobIDis set.Credit to @dilyanpalauzov for identifying the
AuthservIDWithJobIDinconsistency.