Suped

What causes OpenDKIM to incorrectly validate DKIM signatures for emails with long headers?

Summary

OpenDKIM, a widely used open-source implementation for DKIM signing and verification, can sometimes incorrectly validate DKIM signatures, especially for emails with unusually long headers. This issue stems from how OpenDKIM handles header canonicalization, a process that normalizes email headers before signing or verification. A known bug, observed since 2014, leads to discrepancies in how such headers are processed, causing valid signatures to be deemed invalid by other systems (or vice versa, if OpenDKIM is the signing entity).

Suped DMARC monitor
Free forever, no credit card required
Get started for free
Trusted by teams securing millions of inboxes
Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo

What email marketers say

Email marketers are often the first to notice the effects of DKIM validation failures, such as diminished inbox placement or increased spam flagging. While they may not directly manage mail server configurations, the downstream impact on campaign performance is significant. They emphasize the frustration of authentication issues that appear subtle but can lead to widespread deliverability problems, underscoring the importance of robust technical setup and continuous monitoring.

Marketer view

A marketer from Email Geeks suggests that the issue of OpenDKIM producing false validation failures for long headers is quite significant. This highlights a critical bug that can impede email deliverability.

25 Mar 2019 - Email Geeks

Marketer view

A marketer from Email Geeks humorously questions if the latest version of OpenDKIM is being used. This implies that keeping software updated is a common troubleshooting step for such issues.

25 Mar 2019 - Email Geeks

What the experts say

Email deliverability experts frequently encounter the nuances of MTA configurations and authentication protocols like DKIM. They understand that specific software implementations, such as OpenDKIM, can harbor subtle bugs that lead to widespread validation failures, even when general configurations appear to be correct. This specific issue highlights the critical challenge of canonicalization, especially when dealing with long or complex header lines, which can deviate from expected standards and cause legitimate emails to fail authentication.

Expert view

An expert from Email Geeks discovered an interesting phenomenon where OpenDKIM was giving false validation failures. This finding pointed to a significant issue within the system.

25 Mar 2019 - Email Geeks

Expert view

An expert from Email Geeks indicates that if a header has a very long word at the beginning, especially with MIME encoding, the header folding might occur immediately after the header name. This specific structure can cause canonicalization problems.

25 Mar 2019 - Email Geeks

What the documentation says

Official documentation for DKIM (RFC 6376) and OpenDKIM lays out the precise mechanisms for signing and verifying email messages. It meticulously defines canonicalization methods (simple and relaxed) for both headers and bodies, detailing how white space and line folding should be handled to ensure consistent signatures. Any deviation from these specifications, even subtle ones within software implementations, can lead to validation failures, making adherence to these standards critical for proper email authentication.

Technical article

The Mail-in-a-Box GitHub issue discusses how using relaxed or simple canonicalization can lead to invalid DKIM signatures for long header lines. This highlights a known vulnerability in how DKIM processes certain header formats.

10 Jan 2020 - GitHub

Technical article

RFC 6376, in its canonicalization section, states that a canonicalization algorithm defines the method used to prepare a message for signing and verification. This preparation is essential to prevent subtle modifications to the message from invalidating the signature.

07 Sep 2011 - RFC 6376

10 resources

Start improving your email deliverability today

Get started