What 5.7.27 means
Google requires senders of more than 5,000 messages a day to Gmail to set up both SPF and DKIM. A 5.7.27 says the SPF half failed for this message, even if DKIM passed. The 4.7.27 version is a temporary rate limit; the 5.7.27 version is a block.
SPF is checked for the envelope sender domain (the Return-Path, also called MAIL FROM), not the From address you see. With many sending services, that's a bounce subdomain such as em123.yourdomain.com or the service's own domain.
Why SPF fails
| Cause | How to spot it | Fix |
|---|---|---|
| The sending server isn't listed | spf=fail or softfail with the IP in the bounce | Add the service's include or the IP. |
| More than 10 DNS lookups | spf=permerror; our check shows the total | Remove unused includes; replace a/mx with ip4: where you can. |
| Two SPF records on one name | spf=permerror | Merge them into one v=spf1 record. |
| Syntax error | spf=permerror | Rebuild it with the SPF generator. |
| No SPF at the Return-Path domain | spf=none | Publish SPF on that exact name, or set up the service's custom return path. |
Fix it step by step
- Open a message from the failing system in Gmail → Show original, or paste its headers into the header analyzer. Note the
smtp.mailfromdomain and the sending IP. - Check that domain with the SPF checker. It expands every include and counts lookups the way receivers do.
- Add what's missing to the same record. Never publish a second SPF record.
- If the service sends from its own Return-Path domain, its SPF is the service's job. Your part is DKIM with your domain for DMARC alignment.
One record, every sender
- Type
- TXT
- Host / name
- @
- Value
- v=spf1 include:_spf.google.com include:<your sending service> ~all
Questions
My DKIM passes. Why does Gmail still block on SPF?
For bulk senders Google requires both SPF and DKIM, so passing one isn't enough for this rule, even though DMARC itself only needs one aligned pass.
Does ~all or -all matter for 5.7.27?
Either way, if the sending IP isn't authorised the result isn't a pass. -all makes it a hard fail, which can also trigger Gmail's SPF hard-fail version of 550 5.7.26.
Which domain's SPF record does Gmail check?
The envelope sender (Return-Path / MAIL FROM) domain. Gmail's 4.7.27 bounce names it: “SPF domain-name with IP address…”.
I'm below 5,000 messages a day. Does this apply?
This error is about Gmail's bulk-sender rule. Smaller senders need SPF or DKIM; without either, Gmail answers with 5.7.26 instead.
Sources
- Google Workspace — Gmail SMTP errors and codes
- Google Workspace — Set up SPF
- Google — Email sender guidelines
- RFC 7208 — Sender Policy Framework (SPF)
Last reviewed: