Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My emails are rejected because DKIM is not passing

Short answer

DKIM adds a signature to each email that receivers check against a public key in your DNS. It fails when the key was never published, the wrong selector is used, the message is changed after signing, or a new sending service was never set up. Google says it can take up to 48 hours to start working.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • A mail test or Gmail's Show original says DKIM fail, or none.
  • Mail sent from my own mailbox passes, but mail from my website or newsletter tool does not.
  • I changed email provider and mail got worse.
  • My service says the domain is not verified.
  • Bounces say the message was rejected because of authentication.

Why does this happen?

  1. The public key is not in DNS

    DKIM works with a key pair: the private key signs each message on the sending side and the public key sits in a DNS TXT record at the domain. If the record was never added, or was added at the wrong name, receivers cannot verify the signature.

  2. The selector does not match

    The record name is the selector followed by ._domainkey. The default Google selector is google, and Google says to choose a different prefix if another key already uses it. A mismatch between the selector the service signs with and the one published makes the check fail.

  3. Each sending service signs for itself

    A shop, newsletter tool or CRM that sends in your name needs its own DKIM set-up. Mailgun, as one example, lists a DKIM record among the DNS records it requires to verify a domain.

  4. Something changes the message after signing

    Google notes that outbound gateways can modify messages, for example by adding footers, which can break DKIM.

  5. The key is too weak or not yet active

    Google's guide says to use a 2048-bit key if the domain provider supports it, otherwise 1024-bit, and that a new key can take up to 48 hours to start working.

What can I do about it today?

  1. Send a test to a Gmail addressOpen the message in Gmail and choose Show original. Google says to look for DKIM=pass in the authentication results. You cannot check by emailing yourself inside the same account.
  2. Find which service sent the failing mailThe header shows the sending service. DKIM is set up per service, so you need to know which one to fix.
  3. Ask for a copy of the current DNS recordsWhoever manages your domain can export the TXT records. Keep that copy before anyone changes anything.
  4. Do not switch on enforcement before the record is liveGoogle's guide says not to start authentication in the admin console until the DNS record is in place.
  5. Wait before retryingA change can take up to 48 hours to show. Test again after that rather than editing repeatedly.

When should I bring someone in?

  • Customer-facing mail such as invoices or order confirmations is being rejected.
  • Several tools send as your domain and nobody has the list.
  • DKIM passes in one test and fails in another.

How do I handle it?

  1. Read the signature in a failing messageThe DKIM-Signature header names the selector and domain used. I compare that to what is in DNS.
  2. Set up each sender separatelyI publish the key each service asks for, at the exact name it expects, and keep the list of selectors in use.
  3. Check what happens after signingI look for footers, gateways or forwarding that alter the message and move the signing step if needed.
  4. Confirm with real mailI send to several mailbox providers and confirm DKIM passes for the domain in the visible From address.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Do I need DKIM if I already have SPF?

Google requires every sender to set up SPF or DKIM, and bulk senders to have both, plus DMARC. Having both is the safer position.

How long until DKIM works?

Google says it can take up to 48 hours after the key is added to DNS.

What key length should be used?

Google recommends 2048-bit if your domain provider supports it, otherwise 1024-bit.

Can I test it by sending to myself?

Google says you cannot verify that way. Send to a Gmail or Workspace user and read the authentication results.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.