Skip to main content

Why one email sender can fail SPF while another keeps working

Updated 3 min readMarkdown

Your app's receipts arrive, but the newsletter starts showing SPF errors. The tempting response is to change the domain's entire SPF record. A better first step is to compare the two mail streams.

The difference may be the domain being checked, the sending IP, or the point at which evaluation stops. A record that looks unchanged in a DNS dashboard can produce different results for different messages.

Compare identities before comparing records

Take one receipt and one newsletter received by the same mailbox provider. Open the original headers and note the envelope-sender domain and the receiver's SPF result for each.

SPF normally evaluates the MAIL FROM identity. A visible From address such as updates@example.com does not prove the receiver checked example.com; the actual envelope sender may use bounce.example.com or a provider's domain.

Make a small comparison:

Evidence Receipt Newsletter
Visible From domain example.com example.com
Envelope domain Record from headers Record from headers
Sending IP Record from receiver Record from receiver
Receiver SPF result Copy exact value Copy exact value

The table prevents you from “fixing” a root-domain policy that was never involved in the failing message.

SPF evaluation follows a path

Consider this deliberately fictional record:

v=spf1 include:receipts.example.net include:news.example.org ~all

Do not publish it; the names are placeholders.

SPF considers mechanisms from left to right. A sender matching the first include can finish earlier than a sender that requires later mechanisms. Includes can reference additional records, so counting only the includes visible in the top-level TXT value misses work deeper in the chain.

RFC 7208 section 4.6.4 limits evaluated DNS-triggering terms to ten. The relevant terms include include, a, mx, ptr, exists, and redirect. Exceeding the limit produces permerror; that is different from the softfail associated with ~all.

Inspect the dependencies without overreading the count

Use the SendPanda SPF checker to inspect the policy and its include/redirect dependencies. It can flag common configuration issues such as duplicate SPF policies and recursive includes.

Read its limitation carefully: it explores branches without knowing a message's sending IP. Its count is an inventory, not a complete simulation of the receiver's evaluation. A high number is useful evidence about complexity, but does not by itself prove that every message exceeds the limit.

Pair that inventory with an SPF evaluator that accepts the actual sender IP and with receiver evidence from the failing message.

Make the smallest supported change

List which service owns each entry. Ask the person responsible for that service whether it still sends mail, and confirm its current domain setup instructions. Google's SPF setup guide also starts with identifying your senders.

If an obsolete sender is confirmed, remove its obsolete authorization. If two SPF policies exist at the same name, plan one policy that preserves the legitimate senders. Do not delete unrelated TXT records or replace the whole policy with a single provider's sample.

Retest receipts and newsletters after the edit. Include a less frequent message type, such as an invoice or account invitation, in your follow-up checks. The goal is a simpler policy with evidence that the services you use still authenticate correctly.

Disclosure: This article promotes SendPanda tools. This is a diagnostic guide, not a claim about observed customer results.

No comments yet. Be the first to comment.