Why is SPF alone not enough to stop spoofing?
SPF alone cannot stop spoofing because it only checks whether the sending server may use the envelope sender domain (RFC5321.MailFrom). It never checks the From address the recipient actually sees. An attacker can pass SPF for their own domain while showing your domain in the From header. Only DMARC alignment ties the two together.
SPF (Sender Policy Framework, RFC 7208) is still a necessary layer. It is just not a spoofing control on its own. This article walks through the five structural limits that keep SPF from protecting the visible From address, shows what DKIM and DMARC each add, and ends with a checklist an MSP can run across every client domain. For the fundamentals, start with our SPF pillar guide.
Key takeaways
- SPF authorises an IP address for the envelope sender domain. It says nothing about the
From:header, which is the address people read and the one attackers forge. - Under RFC 9989 (DMARCbis), an SPF pass only counts when the MAIL FROM domain aligns with the From domain.
- SPF fails with permerror above 10 DNS-querying terms or more than two void lookups, and it fails after ordinary forwarding.
- For DMARC,
~alland-allboth mean "not a pass". The practical difference is that-allcan trigger a rejection before DMARC runs. - Protect each client domain with SPF, aligned DKIM for every sender, and a DMARC policy moved from
p=nonetop=reject.
What does SPF actually check?
SPF checks one question: is this connecting IP address authorised to send mail using this domain in the SMTP envelope? RFC 7208 section 2 says the "MAIL FROM" and "HELO" identities are the ones checked. The receiver looks up the TXT record of the domain in the MAIL FROM command (also called the Return-Path or bounce address) and compares the connecting IP against it.
That design is deliberate. The envelope sender is where bounces go, and SPF was built to stop forged bounce addresses. The RFC itself is clear about what it does not cover: section 11.2 warns that a malicious sender can use their own domain in the identities SPF checks, while the message can "easily list other identities in its header", naming the From header as an example.
So an SPF pass tells you something about the envelope. It tells you nothing about the name and address in the recipient's inbox.
Why does the visible From address matter more?
The visible From address (RFC5322.From) is what the recipient trusts, and it is the one field SPF ignores. Here is how a basic spoof gets an SPF pass:
MAIL FROM:<bounce@attacker-example.net> SPF checks this domain
From: "Accounts" <accounts@client-example.co.uk> the recipient sees this
The attacker publishes a valid SPF record for attacker-example.net and sends from an IP it authorises. The receiver records spf=pass, but for the attacker's domain. Without DMARC, nothing links that pass back to client-example.co.uk. The message looks like it came from your client and carries a genuine authentication pass.
This is also why our article on why DMARC fails when SPF passes is one of the most common support questions: a pass for the wrong domain is not a pass for DMARC.
How does RFC 9989 alignment fix the envelope problem?
RFC 9989 fixes it by requiring the SPF-authenticated domain to align with the From domain. Section 4.4.2 says "DMARC relies solely on SPF validation of the MAIL FROM identity", and that only an SPF-authenticated identifier with Identifier Alignment to the Author Domain is enough. The HELO identity does not count towards DMARC, except through the null sender case described below.
Alignment comes in two modes, set with the aspf tag:
- Relaxed (the default): the MAIL FROM domain and the From domain share the same Organisational Domain, so
bounce.client-example.co.ukaligns withclient-example.co.uk. - Strict (
aspf=s): the two domains must be identical.
A DMARC pass needs at least one aligned pass, from SPF or from DKIM (RFC 9989 section 5.3.5). The attacker in the example above passes SPF for attacker-example.net, which does not align with client-example.co.uk, so SPF contributes nothing and DMARC fails. With a policy of p=quarantine or p=reject, the receiver is asked to act on that failure. Our guide to relaxed and strict alignment covers the edge cases.
One detail matters for bounces: when the MAIL FROM is empty (a null sender, used by bounce messages), RFC 9989 section 3.2.4 says the identity becomes the postmaster mailbox at the HELO domain. That is the only route by which HELO enters DMARC.
Why does SPF break at 10 DNS lookups?
SPF breaks at 10 lookups because RFC 7208 section 4.6.4 caps the number of DNS-querying terms. The include, a, mx, ptr and exists mechanisms and the redirect modifier all count, and "If this limit is exceeded, the implementation MUST return permerror". The ip4, ip6 and all mechanisms do not count.
Every SaaS platform a client adds usually brings another include:, and nested includes count too. A record that worked last year can tip over the limit when one provider changes its own include chain. DMARC treats a permerror as no SPF pass, so every message that relied on SPF for alignment then fails.
The fixes are covered in detail in SPF too many DNS lookups and, with its maintenance risks, SPF flattening for MSPs. The most durable fix is usually to remove includes for senders that already sign with aligned DKIM, or to move them to a subdomain with its own record.
What are void lookups and why do they cause permerror?
A void lookup is a DNS query made during SPF evaluation that returns no answer or a "domain does not exist" (NXDOMAIN) response. RFC 7208 section 4.6.4 says implementations SHOULD limit void lookups to two, and that exceeding the limit produces permerror.
Void lookups come from stale records: an include: for a provider the client cancelled, an a: pointing at a decommissioned host, or a typo in a domain name. They are easy to miss because the record still looks plausible in the DNS console. Three dead references can break SPF for the whole domain even when the total lookup count is well under 10. Our page on SPF permerror shows how to trace each one.
A related cause of permerror is publishing two SPF records on the same name. RFC 7208 section 4.5 says that if more than one record is found, the result is permerror. See how to merge multiple SPF records.
Why does email forwarding break SPF?
Forwarding breaks SPF because the forwarding server connects to the final receiver from its own IP address while keeping the original MAIL FROM. RFC 7208 section 10.3 explains that SPF is then evaluated against the mediator's address, and "the SPF evaluation will fail" unless mitigations are used.
Appendix D of RFC 7208 describes the main mitigation: the forwarder rewrites the MAIL FROM into its own domain (as Sender Rewriting Scheme does). That makes SPF pass again, but for the forwarder's domain, which does not align with your client's From domain. Either way, SPF cannot carry a DMARC pass through a plain forward.
DKIM usually survives forwarding, because the signature travels inside the message and does not depend on the connecting IP, as long as the forwarder does not modify the signed content. Mailing lists that add footers or subject tags can break DKIM too. Our guide to DMARC and email forwarding explains what this looks like in aggregate reports.
Does ~all or -all make SPF strong enough?
No. The qualifier on all changes how a receiver may treat an unauthorised IP, but it does not change what SPF checks. A strict -all still only covers the envelope sender, so the From header spoof above passes exactly as before.
RFC 7208 defines the two results differently. Section 8.5 says a "fail" is an explicit statement that the client is not authorised. Section 8.4 says a "softfail" sits between fail and neutral, and receivers SHOULD NOT reject the message based solely on it.
From DMARC's point of view, though, they are the same: neither is a pass, so neither can produce an aligned SPF pass. Once DMARC is in place, the DMARC policy is what tells receivers what to do with unauthenticated mail. The one real difference is timing. RFC 9989 section 7.1 warns that -all "could cause a message to be rejected early in the SMTP transaction, before any DMARC processing takes place". Such messages never appear in aggregate reports, and a message with a valid aligned DKIM signature can still be rejected solely because of the SPF fail.
That is why many administrators keep ~all once DMARC is enforcing. We compare both options in SPF ~all vs -all with DMARC.
What do SPF, DKIM and DMARC each cover?
Each protocol answers a different question, and only DMARC connects the answers to the visible From address. The table summarises what each one checks and where it stops.
| Question | SPF (RFC 7208) | DKIM (RFC 6376) | DMARC (RFC 9989) |
|---|---|---|---|
| Which identity is checked? | MAIL FROM (and HELO) domain | The d= signing domain |
The RFC5322.From (Author) domain |
| What is the proof? | Connecting IP is listed in DNS | Cryptographic signature verified with a DNS public key | An aligned SPF or DKIM pass |
| Checks the visible From? | No | No, not on its own | Yes, through alignment |
| Survives plain forwarding? | No | Usually, if the signed content is unchanged | Yes, when DKIM survives |
| Main failure modes | 10 lookup limit, void lookups, multiple records, forwarding | Modified content, missing or wrong selector key, weak keys | No aligned pass, or no record published |
| Tells receivers what to do? | Only a pass or fail result | Only a pass or fail result | Yes: p=none, quarantine or reject |
| Sends reports to the domain owner? | No | No | Yes, aggregate reports under RFC 9990 |
The reverse limit also applies: DKIM on its own does not bind to the From domain either. A message can carry a valid signature for any domain the sender controls. We cover that side in why DKIM alone is not enough, and the full picture in how SPF, DKIM and DMARC work together.
Can SPF still help once DMARC is in place?
Yes. SPF still gives DMARC a second path to a pass when a DKIM signature breaks, and it is often the only aligned path for older systems such as printers, line-of-business apps and on-premises relays that cannot sign. Mailbox providers also use SPF results as one signal among many.
The point is not to drop SPF. It is to stop treating an SPF pass as proof the message came from your client. RFC 9989 section 7.1 also encourages domain owners to review their SPF records carefully, because overly broad records (large shared ranges, +all, or a provider include that covers thousands of customers) authorise far more senders than intended.
What should an MSP check on every client domain?
An MSP should check that every client domain has one valid SPF record within its limits, aligned DKIM for each sender, and a DMARC policy moving towards enforcement. Run this checklist per domain, and repeat it when a client adds or drops a sending service.
- One SPF record per name. Confirm there is exactly one
v=spf1TXT record at the domain and at each sending subdomain. How to check your SPF record shows the commands. - Count lookups and void lookups. Stay under 10 DNS-querying terms including nested includes, and remove every include or
a:that returns no answer. - Map each sender to its alignment path. For every platform in the aggregate reports, note whether it passes through aligned SPF, aligned DKIM or both. A sender that passes SPF only for its own bounce domain is relying on DKIM, whether you planned it or not.
- Enable aligned DKIM everywhere it is offered. That keeps mail passing DMARC through forwarding and lets you trim SPF includes.
- Choose
~allor-alldeliberately. Record the reason in the client's documentation, with the early rejection risk from RFC 9989 section 7.1 in mind. - Publish DMARC and move through the policies. Start at
p=none, thenp=quarantine, thenp=reject. RFC 9989 has no percentage rollout, so uset=yif you want receivers to apply one level below the published policy while you test. Setnp=to cover non-existent subdomains. - Watch the reports, not the records. Aggregate reports show which sources fail and why. RFC 9990 limits the SPF scope in those reports to
mfrom, which matches what DMARC evaluates.
The last step is where multi-tenant tooling earns its keep. Grouping each client's report sources by platform shows which senders rely on SPF alone before the client moves to enforcement. Our guide to moving from monitoring to enforcement safely sets out the full sequence.
Frequently asked questions
Can an attacker pass SPF while spoofing my domain?
Yes. SPF only checks the envelope sender domain, so an attacker can use their own domain in MAIL FROM, pass SPF for it, and put your domain in the visible From header. DMARC stops this because the attacker's SPF pass does not align with your From domain, and they cannot create a new aligned DKIM signature without your private key.
Is SPF with -all enough without DMARC?
No. A hard fail only applies when the envelope sender is your domain. It does nothing for messages that use another envelope domain and show your domain in the From header. Without DMARC there is also no alignment check, no policy for receivers and no aggregate reporting, so you cannot see who sends as your domain.
Can I remove SPF once DKIM and DMARC are working?
It is not recommended. SPF gives DMARC a second aligned path when a DKIM signature breaks, and some systems such as printers or legacy apps can only pass through SPF. Keep a lean SPF record that lists your real senders, and rely on aligned DKIM as the path that survives forwarding.
Why does my SPF fail even though the record looks correct?
The usual causes are more than 10 DNS-querying terms once nested includes are counted, more than two void lookups from stale entries, two SPF records on the same name, or forwarded mail arriving from a server you never listed. Each produces a failure that the record alone does not reveal.
Next steps
Review the fundamentals in the SPF pillar guide, then check each client against the limits in SPF record best practices. Make sure every sender signs with DKIM, read your DMARC aggregate reports per source, and follow the DMARC pillar to plan enforcement.