Skip to content

Commit 016c425

Browse files
authored
feat: add walk-mode selection and cross-mode comparison to opendmarc-check (#431)
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.
1 parent d3a63b0 commit 016c425

2 files changed

Lines changed: 285 additions & 96 deletions

File tree

opendmarc/opendmarc-check.8.in

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,55 @@
44
\- DMARC record check tool
55
.SH SYNOPSIS
66
.B opendmarc-check
7+
[\-p pslfile]
8+
[\-m mode | \-a]
79
domain [domain [...]]
810
.SH DESCRIPTION
911
.B opendmarc-check
1012
queries the DNS for a DMARC record for the named domain(s) and then translates
1113
the content found to a human-readable form. This can be used to ensure that
1214
the DMARC policy you have placed in the nameserver is what you intended for
1315
others to see.
16+
17+
.B opendmarc-check
18+
uses the same libopendmarc query path as the milter itself, so its output
19+
reflects exactly what the filter would do for a given domain, including
20+
which organizational domain it would land on and by what mode.
21+
.SH OPTIONS
22+
.TP
23+
.I \-p pslfile
24+
Load the named Public Suffix List file before querying. Required for the
25+
.I psl
26+
walk mode to find an organizational domain; also affects
27+
.I auto
28+
mode. Without this option no PSL is loaded, matching the longstanding
29+
default behavior of this tool.
30+
.TP
31+
.I \-m mode
32+
Use the named walk mode to determine the organizational domain when the
33+
queried domain itself has no DMARC record.
34+
.I mode
35+
is one of
36+
.IR auto " (the default),"
37+
.IR psl ", " rfc7489 ", or " rfc9989 .
38+
See
39+
.I DMARCbisWalkMode
40+
in
41+
.I opendmarc.conf(5)
42+
for what each mode does. Mutually exclusive with
43+
.I \-a.
44+
.TP
45+
.I \-a
46+
For each domain, query using all four walk modes in turn and print one
47+
line of results per mode, instead of the normal detailed single-mode
48+
report. Useful for comparing how
49+
.I psl,
50+
.I rfc7489,
51+
and
52+
.I rfc9989
53+
diverge or agree on a given domain's organizational domain and policy.
54+
Mutually exclusive with
55+
.I \-m.
1456
.SH VERSION
1557
This man page covers version @VERSION@ of
1658
.I opendmarc.

0 commit comments

Comments
 (0)