At a glance
- Type: permanent failure (class 5, RFC 3463 §2). The sending server does not retry it and reports the failure to the sender: a bounce message, or an error in the mail app.
- Basic code: varies. The IANA registry lists it with 451 and 550.
- Enhanced code 5.7.24: “SPF validation error” in the IANA registry (RFC 7372), in the group security or policy status (RFC 3463 §3.8).
The SPF check did not say your server was unauthorized. It never reached an answer, and the receiver refused the message for that reason.
What it means
RFC 7372 §3.2 defines X.7.24, "SPF validation error", for an SPF evaluation that ended in an error. It takes the place of the codes RFC 7208 gave for its two error results:
- permerror (RFC 7208 §8.7): the domain's records could not be interpreted, and someone has to fix them in DNS. RFC 7208 suggested 550 with 5.5.2. With the newer code this is 550 5.7.24.
- temperror (RFC 7208 §8.6): a transient error, generally in DNS, stopped the check. RFC 7208 suggested 451 with 4.4.3. With the newer code this is 451 4.7.24. Your mail system keeps the message and retries on its own, and a later try may pass.
A 5.7.24 is not the same as 550 5.7.23. There the check finished and said your server is not allowed. RFC 7208 §8.6 also notes that a temperror can come from DNS trouble on either side, the sender's or the receiver's. For a DNS failure reported without SPF, see 4.4.3.
How Gmail uses it
Gmail uses 5.7.24 when the SPF record of the sending domain has one or more entries it finds suspicious (Gmail SMTP errors and codes). As 451 4.7.24 Gmail limits the rate of mail from your IP address for a while. As 550 5.7.24 it refuses the message. Google points senders to its sender guidelines for the fix. Check the record with the SPF checker and remove any entry you cannot explain.
Common causes
For a permerror, RFC 7208 names these:
- Two SPF records at the same name (§4.5).
- A syntax error anywhere in the record (§4.6).
- More than 10 terms that need DNS lookups. Those are include, a, mx, ptr, exists and redirect (§4.6.4).
- More than two lookups that return nothing, which the RFC calls void lookups (§4.6.4). Two is the RFC's recommended default; a receiver may set its own limit.
- An include or redirect that points to a domain with no SPF record (§5.2, §6.1).
For a temperror:
- A DNS server for your domain timed out or answered with an error.
- The check took longer than the receiver allows. RFC 7208 §4.6.4 suggests a limit of at least 20 seconds.
How to fix it
If you are the sender:
- Run your domain through the SPF checker. It shows the record, every record it includes and the total number of lookups.
- Keep one SPF record. Merge any second record into it.
- If you are over 10 lookups, drop includes you no longer need, or list addresses with ip4 and ip6, which need no lookup. See the SPF lookup limit.
- For Gmail's 451 4.7.24 or 550 5.7.24, fix the entries it finds suspicious (steps 1 to 3). For another receiver's 4.7.24, a temperror, make sure your DNS servers answer reliably: the message stays queued and goes out once a check succeeds.
- After a 5.7.24, resend once the fixed record is live.
If you run the receiving server, reply 451 4.7.24 for a temperror and keep 550 5.7.24 for a permerror. RFC 7208 §8.6 also lets you accept the message on a temperror.
What to do with the address
Keep it: this code is about your setup, not the mailbox. The problem is your domain's SPF record or its DNS.
The address on your list is not what failed here. For the bounces your list does cause, clean the list before you send.