For SpamAssassin 3.4.2 I've added the below configuration ruleset to local.cf
with the intent of providing a spam score for failed DMARC tests.
The DMARC and SPF Authentication-Results headers are created by opendmarc
and the DKIM Authentication-Results header by opendkim
.
The expected output is a score for all three header results added to the X-Spam-Report header.
The actual output is only for a domain that has p=reject
or p=none
with the appropriate score added to the X-Spam-Report header, but for p=quarantine
nothing is added to the X-Spam-Report header even though the DMARC, DKIM and SPF Authentication-Results headers have been added as expected.
Added to /etc/spamassassin/local.cf
:
ifplugin Mail::SpamAssassin::Plugin::AskDNS
askdns __DMARC_POLICY_NONE _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=none;/
askdns __DMARC_POLICY_QUAR _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=quarantine;/
askdns __DMARC_POLICY_REJECT _dmarc._AUTHORDOMAIN_ TXT /^v=DMARC1;.*\bp=reject;/
meta DMARC_REJECT !(DKIM_VALID_AU || SPF_PASS) && __DMARC_POLICY_REJECT
score DMARC_REJECT 10
meta DMARC_QUAR !(DKIM_VALID_AU || SPF_PASS) && __DMARC_POLICY_QUAR
score DMARC_QUAR 5
meta DMARC_NONE !(DKIM_VALID_AU || SPF_PASS) && __DMARC_POLICY_NONE
score DMARC_NONE 0.1
endif # Mail::SpamAssassin::Plugin::AskDNS
What is wrong with the configuration?