Skip to content

Fix authserv-id quoting and apply AuthservIDWithJobID to SPF header (issue #17)#311

Open
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/issue-17-ar-header
Open

Fix authserv-id quoting and apply AuthservIDWithJobID to SPF header (issue #17)#311
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/issue-17-ar-header

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Fixes #17.

Two related bugs in Authentication-Results header generation:

1. Invalid authserv-id format when AuthservIDWithJobID is set

The 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_hdr is 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. AuthservIDWithJobID ignored for spf= header

The spf= A-R header emitted by SPFSelfValidate used bare authservid regardless of the AuthservIDWithJobID setting, while the dmarc= header honoured it. 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 across all emitted Authentication-Results headers when AuthservIDWithJobID is set.

Credit to @dilyanpalauzov for identifying the AuthservIDWithJobID inconsistency.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant