OpenDKIM can incorrectly validate DKIM signatures for emails with long headers due to a combination of canonicalization discrepancies, header modifications during transit, and specific software bugs. Issues often arise from OpenDKIM's inconsistent handling of whitespace, line folding, and character encoding in complex or mime-encoded long headers, sometimes deviating from standard RFCs or the signing server's process. Furthermore, alterations made by various message transfer agents, email clients, or security solutions after an email has been signed can change long headers, leading to a mismatch with the original signature. This problem is compounded by known, long-standing bugs related to specific header types like 'List-Unsubscribe' and vulnerabilities concerning excessively long header names.
9 marketer opinions
OpenDKIM can incorrectly validate DKIM signatures for emails containing long headers due to a range of factors, primarily stemming from its sensitive interpretation of header formatting. This often involves discrepancies in how OpenDKIM performs canonicalization, particularly for long words within mime-encoded headers like 'List-Unsubscribe', or when handling varied whitespace and line folding. Furthermore, modifications made to these headers by various intermediaries-such as Message Transfer Agents (MTAs), email clients, or security solutions like spam filters and antivirus software-after an email has been signed, can alter the header content, leading to a mismatch with the original signature. These issues are compounded by known, long-standing bugs within OpenDKIM itself related to header parsing and unfolding, which can cause legitimate emails to fail validation, even in the latest software versions.
Marketer view
Marketer from Email Geeks explains that OpenDKIM can give false validation failures due to incorrect canonicalization when headers contain long words, such as in mime-encoded List-Unsubscribe headers, leading to DKIM validation failures. This bug has been present since 2014 and affects both signing with OpenDKIM and validating mail signed by it. He confirms the bug is present in the latest release and current git HEAD.
21 Jan 2023 - Email Geeks
Marketer view
Marketer from Email Geeks shares that they previously encountered this OpenDKIM issue, specifically with Cloudmark (which uses an OpenDKIM wrapper) and List-Unsubscribe headers. This led to a large number of DMARC rejections due to DKIM failing, and they received a patch for it in October 2018.
19 Feb 2022 - Email Geeks
0 expert opinions
Incorrect DKIM validation by OpenDKIM for emails with long headers often results from the intricate interplay of several factors, including the precise handling of header canonicalization, unintended modifications during email transit, and specific internal software defects. OpenDKIM's strict interpretation of header formatting can lead to validation failures when even minor differences exist between the signed header's original form and its state during verification. This is particularly true for complex, multi-line headers where whitespace, line folding, or character encoding variations can cause mismatches. Furthermore, various intermediate systems, such as mail servers or security solutions, may inadvertently alter these headers after the DKIM signature has been applied, further complicating accurate validation. Persistent software bugs within OpenDKIM also contribute to these false negatives, making robust email authentication challenging for senders utilizing long header fields.
6 technical articles
OpenDKIM's occasional failure to correctly validate DKIM signatures for emails with long headers stems from a combination of specific software bugs, its sensitivity to varied header formatting, and potential deviations from internet standards. These issues include a known bug in older versions that mishandled relaxed canonicalization for headers with mixed tabs and spaces, as well as a general sensitivity to how email clients format and fold lengthy headers. Furthermore, OpenDKIM's internal parsing or 'unfolding' of these complex headers may not always perfectly align with RFC specifications, leading to canonical form mismatches. In severe cases, vulnerabilities like buffer overflows triggered by excessively long header names can completely disrupt the validation process, marking legitimate emails as invalid.
Technical article
Documentation from OpenDKIM-users Mailing List explains that OpenDKIM version 2.10.3 had a known bug where its relaxed canonicalization process could fail for headers containing a mix of tabs and spaces. This issue is particularly relevant for long headers which often involve complex spacing and folding, leading to incorrect DKIM signature validation.
11 May 2022 - OpenDKIM-users Mailing List
Technical article
Documentation from OpenDKIM SourceForge Bug Tracker details a bug where OpenDKIM could incorrectly fail signature validation for emails with specific header structures, such as those generated by Microsoft Outlook. This suggests sensitivity in OpenDKIM's header parsing, where differences in how long headers are formatted or folded by email clients can lead to verification failures.
17 Jun 2023 - OpenDKIM SourceForge Bug Tracker
How do I fix DKIM failing body hash verification?
What causes DKIM errors during double DKIM implementation and how can they be fixed?
What causes invalid RSA public key errors in DKIM records and how can I fix it?
Why is Mimecast causing DKIM body hash failures?
Why is Outlook breaking DKIM keys and how can I fix it?
Why is Power MTA failing to sign DKIM for some outbound emails?