Glossary
SPF record: who may send mail for a domain
An SPF record (RFC 7208) is a DNS TXT entry listing the servers allowed to send email for a domain. Syntax, qualifiers, limits and common mistakes.
Updated 2026-11-23
An SPF record is a DNS TXT record, defined in RFC 7208, in which a domain lists the servers allowed to send email for it. A receiving server looks up the record of the domain in the envelope sender, compares the connecting IP address with the list and gets a result: pass, fail, softfail, neutral, none, temperror or permerror.
How it works
The record starts with v=spf1 and is followed by mechanisms, each with an optional qualifier.
example.com. IN TXT "v=spf1 ip4:203.0.113.0/24 include:_spf.mailprovider.example -all"
| Mechanism | Matches |
|---|---|
ip4, ip6 |
An address or a CIDR range |
a, mx |
The addresses of the domain's own A or MX records |
include |
Whatever another domain's SPF record allows |
all |
Everything else, always last |
| Qualifier | Result |
|---|---|
+ (default) |
Pass |
- |
Fail |
~ |
Softfail |
? |
Neutral |
Rules that cause trouble:
- One record per domain. Two SPF TXT records make the check return
permerror. - Ten lookups maximum across
include,a,mx,ptr,existsandredirect.ip4andip6cost nothing. - SPF checks the envelope sender. The
MAIL FROMof the SMTP session, not the visible From header. Alignment with the visible domain is DMARC's job. - Forwarding breaks it. A forwarder sends from its own IP, which is not in your record.
Publish SPF for every domain you send from, and also for domains you never send from, with v=spf1 -all.
Try your own record in the SPF checker. The full picture is in SPF, DKIM and DMARC explained.
Why it matters for validation
A domain with an SPF record is generally one that runs real mail. A domain without one, or without an MX, is often parked, new or abandoned.
The email API reports domain.spf as true when a record is published, false when not and null when not checked. It reports presence, not correctness, and it does not score your own configuration. SPF also feeds the lookup for sender reputation and deliverability: since large mailbox providers expect authenticated bulk mail, a sending domain without SPF has a harder time reaching the inbox.
Use the field as a mild signal, never as a reason to block an address: plenty of valid personal domains have no SPF.
Related
Frequently asked questions
What is an SPF record?
How many DNS lookups can an SPF record trigger?
What is the difference between ~all and -all in SPF?
-all is a hard fail: mail from servers not listed should be rejected. ~all is a soft fail: such mail is suspect but usually accepted and marked. Many senders start with ~all and move to -all once they are sure every legitimate source is listed.Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.
- 100 free credits a month
- No card
- Test keys spend nothing
- Cancel any time