Bug 8270 - DKIM_INVALID when _domainkey query failed/blocked
Summary: DKIM_INVALID when _domainkey query failed/blocked
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: 4.0.0
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-12 18:40 UTC by ek
Modified: 2024-07-12 18:40 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description ek 2024-07-12 18:40:44 UTC
It appeared that in case querying DKIM key (like default._domainkey.somedomain.org) is either blocked on configuration level or fails on some reason, the DKIM_INVALID symbol is set with adding spam score for the message that can be in fact legitimate one.

For example:
Jun 28 09:21:56.419 [75520] dbg: dkim: performing public DKIM key lookup and signature verification
Jun 28 09:21:56.419 [75520] dbg: dns: bgsend, query TXT/default._domainkey.somedomain.org blocked by dns_query_restriction: somedomain.org
Jun 28 09:21:56.419 [75520] dbg: dkim: DKIM signature i=@somedomain.org d=somedomain.org
Jun 28 09:21:56.420 [75520] dbg: dkim: FAILED DKIM, i=@somedomain.org, d=somedomain.org, s=default, a=rsa-sha256, c=simple/simple, unknown key size, invalid, matches author domain

In fact DKIM check itself didn't fail but instead it was not performed, so the real DKIM check status is unknown and not invalid, and the message was not altered, so if query would be successful, it wouldn't fail. According to RFC 6376 section 6.1.2 the result should be "PERMFAIL" that is not equal to "DKIM INVALID", so corresponding symbol should not be set and score should not be added.
This is in fact disputable case but it was found that due to DNS query failing legitimate mail is handled as spam, so false positive result.