What an SPF record is
SPF (Sender Policy Framework, RFC 7208) is one TXT record, published at your domain, that lists the servers allowed to send mail for it. When a receiving server accepts a message, it looks up the SPF record of the domain in the envelope sender (the Return-Path, not the From address people see) and checks whether the connecting IP address is on the list. The answer is pass, fail, softfail, neutral, or an error.
SPF on its own does not protect the visible From address. That is DMARC’s job: DMARC only counts an SPF pass when the envelope domain matches the From domain. SPF is necessary, but it is not enough on its own.
What a working record looks like
v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 -all
v=spf1must come first, and there must be exactly one such record.include:pulls in the list a provider publishes for its own servers.ip4:andip6:authorise addresses or ranges directly.aandmxauthorise the hosts your A and MX records point to.- The final
alldecides what happens to everyone else:-allfails them,~allsoftfails them,?allsays nothing, and+alllets anyone on the internet pass as you.
A domain that never sends mail should still publish v=spf1 -all. Parked and
legacy domains are a favourite for spoofing because nobody watches them.
-all or ~all?
-all is the strict choice: unlisted senders fail. ~all asks
receivers to accept the message but treat it with suspicion, and many large senders publish
it, Google among them. In practice, once DMARC is at p=quarantine or
p=reject, DMARC decides what happens to forged mail and the difference between
the two shrinks. MailPosture therefore marks ~all as a warning, not as a failure.
+all and ?all are different: they authorise nothing useful and
should be replaced.
Common mistakes
- Two SPF records. Adding a second
v=spf1record for a new service instead of editing the existing one is the most common error. RFC 7208 makes more than one record a permanent error, so SPF fails for every message. - More than 10 DNS lookups.
include,a,mx,ptr,existsandredirecteach cost a lookup, and so do the includes inside those includes. Above ten, SPF returns a permanent error. MailPosture counts the terms in your top-level record, so treat its number as a floor: four includes can still exceed ten once the providers’ own records are expanded. - Forgotten senders. The CRM, the helpdesk, the invoicing tool and the
newsletter platform all send as your domain. Leave one out and tighten to
-all, and its mail starts failing. - Typos and pasted characters. A space after the colon
(
include: _spf.google.com), curly quotes copied from a document, or an impossible range likeip4:192.0.2.0/33. Receivers cannot evaluate such a term, and the whole record fails. - Long records split badly. One TXT string holds at most 255 characters. Longer records are published as several quoted strings that receivers join with no space. Some DNS panels handle this for you; others insert a space or cut the record off.
- The
ptrmechanism. RFC 7208 advises against it: it is slow, unreliable, and some receivers ignore it. Replace it withip4/ip6or an include.
How to fix it
- List every service that sends mail with your domain in the From or Return-Path, and look up the include each provider documents.
- Publish one record at the domain apex that combines them, e.g.
v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net ~all. - Delete any second
v=spf1record, including the one your DNS host may have added by default. - Run the check above again after the TTL has passed, and read the record back to make sure it arrived exactly as you typed it.
- Watch DMARC aggregate reports for a couple of weeks before you switch
~allto-all.
What cyber-insurance questionnaires ask
Cyber-insurance applications and renewal questionnaires commonly ask whether SPF, DKIM and
DMARC are configured for your email domains; the exact wording varies between carriers, and
some ask specifically whether DMARC is set to enforce. A yes is easier to stand behind when it
comes with evidence: the record text, the time it was read, and the resolver that answered.
MailPosture prints all three, plus the dig command to reproduce the lookup. Watch
the word all in such questions: it usually includes parked and secondary domains, which
should carry v=spf1 -all and a DMARC record of their own.