Skip to content

feat: add walk-mode selection and cross-mode comparison to opendmarc-check#431

Merged
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:feat/opendmarc-check-walk-modes
Jun 21, 2026
Merged

feat: add walk-mode selection and cross-mode comparison to opendmarc-check#431
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:feat/opendmarc-check-walk-modes

Conversation

@thegushi

Copy link
Copy Markdown
Collaborator

Summary

  • feat: add -m (auto/psl/rfc7489/rfc9989) and -p (Public Suffix List file) to opendmarc-check, exposing the DMARCbis walk_mode knob that opendmarc.c already reads from DMARCbisWalkMode but opendmarc-check never let you pick
  • feat: add -a to query a domain under all four walk modes in one pass and print a comparison line per mode (status, organizational domain, p=, sp=, whether the RFC 7489 fallback walk was used)
  • refactor: extract policy_to_str()/alignment_to_str() helpers from the existing inline switch statements so the classic single-domain report and the new comparison output share one source of truth

This goes through the actual opendmarc_policy_query_dmarc() path the milter uses, not a re-implementation, so it can be used to spot real divergence between walk modes for a given label instead of relying on the Perl survey scripts in contrib/.

Test plan

  • make check in libopendmarc passes (11/11 tests)
  • Clean build, no compiler warnings
  • Manually queried live domains (google.com, mail.google.com) with -m, -a, and -a -p ; confirmed psl/auto/rfc7489/rfc9989 agree when a PSL is loaded and diverge sensibly when it isn't
  • Confirmed -m and -a are rejected together

…check

Adds -m to opendmarc-check to run a single DMARCbis walk mode
(auto/psl/rfc7489/rfc9989), -p to load a Public Suffix List file (PSL
mode and auto otherwise have nothing to query), and -a to query a
domain under all four modes in one pass and print a comparison line
per mode (status, org domain, p=, sp=, whether the RFC 7489 fallback
walk was used).

This exercises the actual opendmarc_policy_query_dmarc() path the
milter uses, not a re-implementation, so it can be used to spot real
divergence between walk modes for a given label rather than relying
on the Perl survey scripts in contrib/.

Extracted policy_to_str()/alignment_to_str() helpers out of the
existing inline switch statements so both the classic single-domain
report and the new comparison output share one source of truth for
p=/sp=/adkim=/aspf= string conversion.
@thegushi thegushi merged commit 016c425 into trusteddomainproject:develop Jun 21, 2026
2 checks passed
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