Gmail error 5.7.27 or 5.7.30: SPF or DKIM did not pass

The full, step-by-step guide to this problem: Yahoo and Outlook rejecting your emails.

Short answer: 5.7.27 means Gmail blocked the message because it did not pass SPF, and 5.7.30 means it did not pass DKIM (both from Google’s own descriptions of the codes). This is not a new rule. Gmail’s sender requirements have been in place since February 2024. What changed is how firmly Gmail applies them: Google’s FAQ says that since November 2025 Gmail “is ramping up its enforcement” (Google, Email sender guidelines FAQ). Mail that does not meet the requirements can be rate limited, rejected for now, or rejected for good. If an order email to a Gmail customer came back, this is one place to look.

What the rejection looks like

The bounce message carries a code that starts with 5.7. Two of them are about the records your domain publishes. Both come from Google’s FAQ, paraphrased:

  • 5.7.27: the message was blocked because it did not pass SPF.
  • 5.7.30: the message was blocked because it did not pass DKIM.

SPF is a list of the servers that may send email for your domain. DKIM is a signature that proves a message really came from your domain. Both live in your domain’s DNS, the public address book of your domain.

What it means

Google’s FAQ lists these 5.7 codes as messages that were blocked, and lists 4.7.27 and 4.7.30 as the temporary versions of the same two failures. By the usual rule of email codes, a code that starts with 5 means “do not retry” and a code that starts with 4 means “try again later”. Gmail says that when it rejects a message it sends a code and a reason, and that you can see the same information in Postmaster Tools, Google’s free dashboard for senders.

Be careful with what this does not say. The wording of these codes mentions bulk senders, and Google’s guidelines ask every sender for SPF or DKIM and bulk senders for all three records, including DMARC (Google, Email sender guidelines). Google gives no numbers on how many small senders are affected. The safe move is to have the records in place whatever your volume.

Fix it in four steps

  1. Read the bounce. Find the code and the line that says SPF or DKIM did not pass. This tells you which record to fix first.
  2. Fix SPF. Your domain must publish exactly one SPF record, and it must list the service that sends your store email. If you added a mail or newsletter tool, add its include: value to the existing record. Do not publish a second one. If you use several services, see SPF too many DNS lookups.
  3. Fix DKIM. In your mail service’s domain settings, publish the DKIM record it gives you, so that your mail is signed with your own domain. Without a key in DNS, the signature cannot be checked.
  4. Publish a DMARC record. Start with the monitoring-only policy p=none, which Google accepts as the minimum. The record and the next steps are in DMARC for beginners.

Then send a test order email to a Gmail address you control. The full steps for all large mailbox providers are in the guide Yahoo and Outlook rejecting your emails.

Check it with the free checker

Open the free SPF, DKIM and DMARC checker and type the exact domain your store sends from. It looks up the three records in DNS and tells you which are missing or broken. Two limits: it does not send an email, so it cannot prove that Gmail accepts your mail. And it tries only 14 common DKIM names, so “Not checked” for DKIM means it did not find your key, not that the key is missing. In that case, compare with the DKIM record your mail service asks you to publish.

One more thing

A record that passed last month can break without anyone noticing, which is why checking once is not enough and re-checks should run on a schedule.

We are thinking about a separate Pro add-on that would do that. It may never be released. If you want to follow the idea, there is a waiting list. Joining is free and commits you to nothing.

Check your own domain

Type your domain into the free checker to see whether your SPF, DKIM and DMARC records are in place. Or install the free plugin, which checks the basics from inside your dashboard.