Skip to content
DMARC Pulse

Email errors

DKIM fail: what dkim=fail means and how to fix it

DKIM fail means the receiver could not verify your signature. Read dkim=fail in your headers, find the cause of the DKIM failure and fix it.

What this means

DKIM fail means a receiving server found a DKIM signature on your message and could not verify it. DKIM signs each message with a private key, and the receiver checks the signature with the public key in your DNS.

RFC 8601 defines the results shown as dkim= in the Authentication-Results header:

  • fail: the signature was checked and failed verification.
  • neutral: the signature had syntax errors or could not be processed.
  • permerror and temperror: an unrecoverable or a likely temporary error stopped the check.
  • none: the message was not signed. Start with DKIM setup.

DMARC, the policy check built on SPF and DKIM, only counts a signature that validates. One valid signature aligned with your From domain is enough, even if another fails.

When a DMARC report says DKIM failed

In aggregate reports, auth_results holds the plain verification result. The dkim value in policy_evaluated is the alignment test. A fail there beside pass in auth_results means a valid signature whose domain does not align with your From domain. Have the service sign with your domain.

Why it happens

A DKIM failure on every message points to the key or the signer. On one path, it points to a system that changed the message.

  • Wrong or missing key. Microsoft names a DNS key that does not match the private key, or a missing key record.
  • Changed message. body hash did not verify means the body changed and has its own fix. signature did not verify means the b= signature failed against the headers in h= and the public key. Mailing lists, transport rules and gateways can change a message after signing.
  • Damaged key record. Google warns that a 2048-bit key does not fit in one 255-character TXT string and can end up truncated. An empty p= means a revoked key.
  • Retired settings. Under RFC 8301, rsa-sha1 signatures and RSA keys under 1024 bits fail permanently.
  • Failed key lookup. temperror may clear on a later attempt. When key lookups time out, Microsoft points to a TXT record that is too large or an authoritative DNS server that is slow to respond.

How to fix it

  1. Paste the full header of a failed message into the Email Header Analyzer.

  2. Note the failed dkim= result and its reason. From the DKIM-Signature matching its header.d or header.i, note d= (signing domain), s= (selector, which picks the key) and a= (algorithm).

  3. Enter d= and s= in the DKIM Checker. For s=s1 and d=example.com, the key lives at s1._domainkey.example.com. Expect one record with a p= value.

  4. Compare it with the value in your sending service. If the selector is a CNAME, compare its target and leave the CNAME in place.

  5. If the record is missing or differs, publish the exact value from the service. If your DNS host caps each string at 255 characters, split the value into quoted strings, in order. Keep a single TXT record per selector.

    Caution: changing a key in use breaks DKIM for mail signed with it. If SPF does not pass and align with your From domain under p=quarantine or p=reject, receivers may junk or reject that mail. Where possible, publish a new selector and confirm it resolves before the service signs with it. RFC 6376 advises keeping the old key for a reasonable interval.

  6. For rsa-sha1, sign with rsa-sha256. For a short key, generate an RSA key of at least 2048 bits, as RFC 8301 advises, with the same caution.

  7. If DNS is correct and only one path fails, find the system rewriting the message. Stop the rewrite, or have it sign after its changes and publish its key first. If every path fails, check the signer and any shared gateway, and confirm h= includes From.

Confirm the fix

  1. Wait for the old DNS record to expire, then send a new message along the path that failed, to a mailbox you control.
  2. Look for dkim=pass with your domain in header.d or header.i. For DMARC, it must also align with your From domain.
  3. In your next DMARC aggregate reports, dkim should read pass in both auth_results and policy_evaluated for the source you fixed.

Check it now

Find and validate DKIM keys

Frequently asked questions

Is dkim=neutral the same as dkim=fail?
The two labels mean different things. RFC 8601 uses fail when the signature was checked and failed verification. It uses neutral for syntax errors, signatures that could not be processed and other failures missing from its list. Neither one gives DMARC a DKIM pass. Not every receiver shows all the values. Microsoft's troubleshooting guide lists only pass, fail and none for this header, so a missing key can show as fail there.
Will a DKIM failure get my email rejected?
RFC 6376 says that, in general, receivers should not decide acceptance based only on an unverifiable signature. Rejection can still happen, because receivers set their own rules. Gmail, for example, requires every sender to authenticate with SPF or DKIM, so a message that passes neither can be blocked with 550 5.7.26, even without a DMARC policy. DMARC is another route. If neither SPF nor DKIM produces an aligned pass and every DNS lookup completed, the message fails DMARC. The receiver then applies its local policy, which may take your p= value into account. If a temporary or permanent DNS error stopped a required lookup, the message neither passes nor fails DMARC and your policy cannot be applied.
Why does DKIM pass at one receiver and fail at another?
The paths can differ, and a forwarder or relay on one path may change the message. Receivers also apply their own limits. Gmail, for example, checks only the first 5 signatures listed in the Authentication-Results header.
My DKIM record exists. Why does DKIM still fail?
A record can exist and still be wrong. It may hold an older key, be truncated or share its selector with a second record. A signed header can also change in transit. Compare the published value with the one in your sending service. On Microsoft 365, DKIM uses CNAME records, and a TXT key at those names is not supported.
Do I need to fix DKIM if SPF already passes?
DMARC needs one aligned pass, so an aligned SPF pass can carry the message. That covers DMARC only. If you send more than 5,000 messages per day to Gmail accounts, Gmail requires both SPF and DKIM to be set up, so fix DKIM either way. Microsoft notes that forwarded mail fails SPF when the forwarding server's IP address is not in the sender's SPF record. A valid, aligned DKIM signature gives you a second route to a DMARC pass when the message is not modified.
How do I see the full header in Gmail?
In a browser, open the message. Next to Reply, click More, then Show original. The full header opens in a new window.

Sources consulted

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.