550 5.7.27 and 421 4.7.27: SPF did not pass

Quick fix

Add the sending service to the SPF record of the Return-Path domain with the include: or IP range the service documents.

How to fix it

  1. Take the IP address from the bounce and the Return-Path domain from the headers of the message.
  2. Add the sending service to that domain's SPF record with the include: or IP range the service documents.
  3. If the service uses its own bounce domain, set a custom Return-Path domain under your domain, so SPF also aligns with the From domain.
  4. Keep one SPF record per domain and stay within 10 DNS lookups.
  5. Send a test to a Gmail address and open Show original: SPF should show PASS.

Learn more: SPF explained: lookups, includes and all

How to check

The SPF lookup counter evaluates the SPF record of a domain with every include and shows each ip4:, ip6: and include: term and the DNS lookup count. Use the Return-Path domain of the bounced message and compare its terms with the IP address in the bounce. After a change, the DNS TTL check shows how long resolvers may still return the old TXT record.

The Free SPF Lookup Counter opens with your domain filled in; it runs when you press Check.

Tools to check it

What the error means

Full error text: 550 5.7.27 This message was blocked because it didn't pass SPF authentication. Gmail requires bulk email senders to authenticate their email with SPF.

421 4.7.27 (rate limited) and 550 5.7.27 (blocked) are Gmail's errors for a bulk sender's message that did not pass SPF. Gmail requires senders of more than 5,000 messages per day to Gmail accounts to set up both SPF and DKIM, so a message that passes DKIM can still get this error.

Google's list of Gmail SMTP errors has two texts:

  • 421 4.7.27: "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."
  • 550 5.7.27: "This message was blocked because it didn't pass SPF authentication. Gmail requires bulk email senders to authenticate their email with SPF."

The bounce continues with the address Gmail checked, for example "Authentication results: SPF with ip-address = did not pass". SPF is checked against the envelope sender: RFC 7208 section 2.4, "SPF verifiers MUST check the "MAIL FROM" identity". That is the Return-Path domain, which can differ from the From domain when a service sends with its own bounce address.

Google's FAQ lists "Messages aren't authenticated with both SPF and DKIM" with the enforcement "Temporary or Permanent Failure codes, or spam foldering". A message that fails both SPF and DKIM can get 550 5.7.26, which applies to all senders.

Sources

All findings