451 4.7.24 and 550 5.7.24: suspicious SPF entries

Quick fix

Remove +all, very large IP ranges and the ptr mechanism from the SPF record, and end it with ~all or -all.

How to fix it

  1. Look up the SPF record of the domain in the bounce and list every term in it, including the records of each include.
  2. Replace +all at the end with ~all (Google's recommendation) or -all.
  3. Replace very large ip4: or ip6: ranges with the addresses or the include your mail provider documents.
  4. Remove the ptr mechanism and list the servers with ip4:, ip6: or include: instead.
  5. Remove includes of services you no longer use, wait for the old record's TTL to pass, and send a new test message.

Learn more: SPF explained: lookups, includes and all

How to check

The SPF flattener unfolds the record and every include into the address blocks it lets pass and marks very large blocks. The SPF check shows the record itself with findings such as +all and ptr. After a change, the DNS TTL check shows how long resolvers may still return the old TXT record.

The SPF flattening check 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.24 The SPF record of the sending domain has one or more suspicious entries.

451 4.7.24 (temporary rate limit) and 550 5.7.24 (permanent rejection) are Gmail's errors for a sending domain whose SPF record Gmail considers suspicious. Google's text names the SPF record, not the DMARC policy, so the fix is in the SPF record of the domain in the bounce.

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

  • 451 4.7.24: "The SPF record of the sending domain has one or more suspicious entries. To protect our users from spam, email sent from your IP address has been temporarily rate limited."
  • 550 5.7.24: "The SPF record of the sending domain has one or more suspicious entries."

Google does not say which entries count as suspicious; its sender guidelines and FAQ do not use the word for SPF. Our recommendation is to look first at entries that let far more servers pass than the domain needs, which our checks report as findings:

  • +all at the end (SPF_PASS_ALL). RFC 7208 section 5.1: "The "all" mechanism is a test that always matches." Its example v=spf1 +all reads "any <ip> passes".
  • Very large address blocks (SPF_FLATTEN_BROAD): our SPF flattener reports IPv4 blocks larger than a /16 and IPv6 blocks larger than a /32.
  • The ptr mechanism (SPF_PTR_MECHANISM). RFC 7208 section 5.5 is titled ""ptr" (do not use)" and says "This mechanism SHOULD NOT be published."

Google's sender guidelines give the other side: "The SPF record for your domain should include all email senders for your domain." Google's SPF help adds "Google recommends you use ~all in your SPF record."

Sources

All findings