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.
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?
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.
Confirmed by knowledge.workspace.google.com
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.
Confirmed by knowledge.workspace.google.com
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.
Confirmed by documentation.mailgun.com
Something changes the message after signing
Google notes that outbound gateways can modify messages, for example by adding footers, which can break DKIM.
Confirmed by knowledge.workspace.google.com
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.
Confirmed by knowledge.workspace.google.comTechnical detail: Mail from your own domain keeps landing in the spam folder
What can I do about it today?
- 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.
- 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.
- Ask for a copy of the current DNS recordsWhoever manages your domain can export the TXT records. Keep that copy before anyone changes anything.
- 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.
- 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?
- Read the signature in a failing messageThe DKIM-Signature header names the selector and domain used. I compare that to what is in DNS.
- 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.
- Check what happens after signingI look for footers, gateways or forwarding that alter the message and move the signing step if needed.
- 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
Messages from our own domain arrive in Gmail's spam folderMail from your own domain keeps landing in the spam folder5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM5.7.57 Client was not authenticated to send anonymous mail during MAIL FROM535-5.7.8 Username and Password not acceptedGmail SMTP login fails with 535 or 534 5.7.14