Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Gmail 550 5.7.27 / 421 4.7.27: "This message was blocked because it didn't pass SPF authentication"

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A business sends an invoice run, a newsletter or a stream of system notifications to customers with Gmail addresses, and the mail comes back with 550 5.7.27. Or it is not refused at all, only slowed, with 421 4.7.27. Both codes carry the same message about SPF, the DNS record that lists the servers allowed to send mail for a domain. The cause is found in the record and in the list of everything that sends mail for the domain, and the fix is a change to one DNS text record.

Everything before the Fix section only reads.

What the error means

Google's page "Gmail SMTP errors and codes" lists two rows for SPF.

The permanent refusal is 550 5.7.27. Its text is "This message was blocked because it didn't pass SPF authentication. Gmail requires bulk email senders to authenticate their email with SPF." A second line follows: "Authentication results: SPF with ip-address = did not pass". The temporary slowdown is 421 4.7.27. Its text is "Your email has been rate limited because SPF authentication didn't pass for this message. Gmail requires all bulk email senders to authenticate their email with SPF." The same page says "gsmtp (Google SMTP) is added to all errors.", so the end of a real bounce carries that marker.

Google's FAQ on the sender guidelines lists both numbers in its enforcement answer, and its requirements table lists "Messages aren't authenticated with both SPF and DKIM" with the enforcement "Temporary or Permanent Failure codes, or spam foldering". The FAQ adds: "Starting November 2025, Gmail is ramping up its enforcement on non-compliant traffic."

Who counts as a bulk sender

The wording is "bulk email senders", so the first question is whether the domain is one. Google's FAQ defines it: "A bulk sender is any email sender that sends close to 5,000 messages or more to personal Gmail accounts within a 24-hour period." It also says: "Messages sent from the same primary domain count toward the 5,000 limit." The sender guidelines page puts the threshold as sending "more than 5,000 messages per day to Gmail accounts". The status does not lapse: "Senders who meet the above criteria at least once are permanently considered bulk senders."

What the rules cover

The rules concern mail sent to personal Gmail accounts, which the guidelines page describes as accounts that end "@gmail.com or @googlemail.com". Senders using Google Workspace must meet them too when sending to personal Gmail accounts. On the guidelines page every sender must "Set up SPF or DKIM email authentication for your sending domains", and a sender of more than 5,000 messages a day must "Set up SPF and DKIM email authentication for your domain." The DKIM counterpart of this error is 550 5.7.30, covered in Gmail 550 5.7.30 / 421 4.7.30. A message that fails both SPF and DKIM gets a different code, covered in Gmail 550 5.7.26.

Likely causes

Each row below is a cause Google names, with the result it produces in a message header.

Cause What Google's SPF pages say Where it shows
No SPF record, or more than one "each domain can have only one SPF record that specifies all hosts or email services" No spf entry in Authentication-Results, or the entry includes best guess record
A sender is missing from the record "If your SPF record doesn't reference all of the services that send mail for your domain, messages from these senders might fail SPF and be rejected or sent to spam." The spf result is neutral, softfail or fail
A typing fault in the record "Typos, extra spaces, or the incorrect use of quotation marks can make the SPF record invalid." The record is invalid
More than 10 DNS lookups "The SPF specification allows for a maximum of 10 DNS lookups" The spf result is temperror or permerror
Forwarding "Even if SPF is correctly set up for your domain, forwarded messages can still fail SPF." Forwarded copies of messages
The sender is not authorised "The message is from an unauthorized sender. In this case, the SPF result is correct." The spf result is neutral, softfail or fail

Google's page on troubleshooting SPF also lists a fault at the domain provider: "Check with your domain provider to rule out current issues with their DNS."

Prove the cause before changing anything

Every step in this section reads and changes nothing.

  1. Read the bounce itself. Write down the code (421 4.7.27 or 550 5.7.27), the line that begins "Authentication results: SPF with", the address printed in that line, and which system sent the message.

  2. List every server and service that sends mail for the domain. Google's SPF page names these kinds: web servers, on-premise mail servers such as Microsoft Exchange, mail servers used by the service host, outbound gateways, services that send automatic email such as "Contact us" forms, and any third-party provider or service that sends email for the domain. Compare the address from step 1 with this list; a sender missing from the SPF record is the first cause in the table.

  3. Count the SPF records. Google says: "To check if you have an SPF record, use one of many free tools available on the web." The domain must have exactly one record that begins v=spf1. If there are two, consolidate them into one.

  4. Read the record's text. Google's page gives the format: records always start with the v=spf1 tag, include: goes in front of each sender domain or IP address, and for a domain that sends with Google Workspace only the record is:

    v=spf1 include:_spf.google.com ~all
    

    Google says it recommends ~all and that the symbol "should be a tilde (~), not a hyphen (-) or a question mark."

  5. Count the lookups. Google's page says to check "the number of lookups in your SPF record using the Check MX tool in the Google Admin Toolbox." The page adds that nested lookups count: if the record includes a domain, and that domain includes other domains, those are counted toward the limit of 10.

  6. Read the header of a message that did arrive. Send a message from the domain to a Gmail address, open it, and, as Google's page on tracing an email with its full header says, next to Reply click More, then Show original. Find the line that starts Authentication-Results and note the text after spf. Google's table of results maps them to causes: no spf entry means the message did not go through an SPF check; best guess record means SPF has not been set up, is set up wrongly, or the domain provider's DNS has a fault; neutral, softfail or fail means the sender's address is missing from the record or is an unauthorised sender; temperror or permerror points to the syntax and the lookup count, or to the domain provider's DNS.

An example, labelled as an illustration: a business sends from example.com.au. Its Google Workspace users and an online invoicing service send as the domain. The bounce names an address that belongs to the invoicing service, and the SPF record lists only Google Workspace. That is the second row of the table: a sender missing from the record.

Fix

The fix is a change to the domain's SPF text record at the domain host. Google's SPF page says that you do not need to change anything in the Google Admin console to set up SPF; the record is made on the page and added at the domain host.

Write down the full current value of the domain's SPF text record, exactly as the domain host shows it (the text that begins v=spf1), and the time. If the domain has no SPF record, write down that there is none.

Disruptive step: the next step changes the SPF text record of the whole domain. Every receiving mail server uses that record, not only Gmail, so a mistake can make mail from every system that sends for the domain fail SPF. Google says that it can take up to 48 hours for SPF authentication to start working after a record is added. The change can be reversed with the value you wrote down.

Add or correct the record at the domain host:

  1. Sign in to the domain host. If you are not sure which company that is, Google's page points to its steps to identify the domain registrar.
  2. Go to the page where the DNS text records for the domain are updated.
  3. Add or update the text record. The type is TXT. For the host (the name, hostname or alias field), enter @ if the host is the same domain you are adding the record to; otherwise enter the domain name. For the value, enter the record built from the list of senders in the proof section.
  4. Update the existing record rather than adding a second one; the proof section's step 3 told you whether a record exists, and the domain must end with one record.

Google's page gives example records for common combinations. For a domain that sends from Google Workspace and Microsoft Office 365:

v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all

Google's page adds that some domain hosts need the record enclosed in quotes, that each subdomain needs its own record, and that "An SPF record can have up to 10 include: tags."

To undo it: set the SPF text record back to the value you wrote down.

Removing the record, only if the domain had no SPF record before

Risk: if you wrote down that the domain had no SPF record, the next step deletes the new text record, which leaves the domain with no SPF, the fault in the title. Google's page on turning off SPF warns that without SPF or DKIM "hackers and other malicious users can impersonate your domain".

Only in that case: delete the new text record. Google's page on turning off SPF says to "delete the DNS TXT record for SPF at your domain provider".

What Google's pages say about the other causes

These are descriptions of Google's pages, not steps.

  • Too many lookups. The page lists the ways to cut them: remove duplicate mechanisms and mechanisms that refer to the same domain, remember that nested lookups count, include only domains that actively send email for the domain, and remove include entries for third parties that no longer send mail for the domain.
  • Broad IP ranges. The page says: "Avoid using broad, shared IP address ranges (often used for cloud hosting/computing) in your SPF record." and points to fixed, assigned addresses for the domain's cloud instance.
  • Forwarded mail. The page's advice is to find out from Email Log Search whether the message was forwarded, and to contact the third party that forwarded it to ask whether they can change how they forward.

Confirm the fix

  • Wait for the delay Google states. The SPF page says up to 48 hours; the troubleshooting page says "it can take between 24-48 hours for these changes to globally take effect".
  • Send a message from each system that sends for the domain to a Gmail address and open the header as in the proof section. None of the results Google's table lists as causes appears: not neutral, softfail, fail, temperror, permerror or best guess record, and the header has an spf entry.
  • Send again to the same recipients that bounced and check that no new 5.7.27 or 4.7.27 answer arrives.
  • A bulk sender can look at the Compliance status dashboard that Google added to Postmaster Tools, which Google's FAQ introduces to help senders meet the requirements.

What to watch afterwards

  • A new sender. Google's SPF page says: "If you start using a new mail server or third-party sender, make sure to update your SPF record".
  • Senders that have stopped. The same page says to keep the record current by removing domains or IP addresses no longer used to send email.
  • The other two authentications. Google's page lists, for senders of more than 5,000 messages a day, SPF, DKIM and DMARC. If SPF is fixed and a 5.7.30 answer arrives, the DKIM article linked above applies.
  • The spam rate. Google's FAQ says: "To comply with the sender guidelines, keep your user-reported spam rate below 0.1% and prevent it from reaching 0.3% or higher."

Risks and limits

The changing step edits a DNS record that every receiving server reads, so the old value must be written down first.

The error text applies to bulk senders as Google defines them, and Google's pages give the threshold in two forms: "close to 5,000 messages or more" in the FAQ and "more than 5,000 messages per day" on the guidelines page. Google's page on turning off SPF states "Google doesn't support issues with your domain host.", so a fault in the host's own DNS is for the domain host to answer.

Sources