What is SPF (Sender Policy Framework)?
SPF is the record published in a domain's DNS that lists which servers are authorized to send email on its behalf. When a message arrives, the receiving server checks that list and learns whether it came from an authorized place or not. It is the domain's front desk, and the first of the three email authentication records. On its own, however, it is not enough: SPF checks the envelope address used in transport, not the sender the person reads on screen.
How SPF works
SPF is a short conversation between the receiving server and the DNS of whoever claims to have sent the message. It happens in milliseconds, before the message is accepted.
The company publishes the list
A text record goes into the domain's DNS declaring which servers may send for it: corporate mail, the marketing platform, the system that issues invoices.
The receiving server reads the envelope
On receiving the message it extracts the domain from the envelope address, the one used in transport and in bounce handling.
It compares the sending address against the list
It queries the record published on that domain and checks whether the server delivering the message is among the authorized ones.
It applies the instruction at the end of the record
On a match, the message passes. With no match, what counts is what the domain owner wrote at the end of the list: a firm refusal or merely a weak flag.
Source: RFC 7208, the official SPF specification published by the IETF, which defines host authorization and the identity being verified, and N-able University's email DNS configuration material.
What SPF does not cover
- It checks the envelope, not what you read. The specification itself warns that SPF-authorized email may contain other false identities. The sender displayed on screen can belong to a different domain, and SPF never looks at it.
- It breaks when a message is forwarded. A forwarding server becomes the origin, and it is not on the original domain's list. Legitimate email fails the check without anyone doing anything wrong.
- It has a query budget. The specification caps at ten the number of record terms that require a DNS lookup. Past the tenth lookup the check returns a permanent error and stops there: whoever sits at the end of the list stops being authorized, legitimate or not.
- It does not tell the receiver what to do. SPF reports whether the origin was authorized; what turns that result into action on the visible sender is DMARC.
What changes at the end of the record
- Firm refusal (-all) Written as a minus sign before all, it declares that anyone not on the list is not authorized, full stop. It is the only instruction that a good share of filters actually act upon.
- Weak flag (~all) Written as a tilde before all, it says the message is probably not authorized but asks for nothing. Many filters simply log it and deliver anyway, which makes the domain look protected without being protected.
- Neutral (?all) Written with a question mark, it explicitly states that the domain commits to no answer at all. The standard says to treat it exactly like the absence of a policy (RFC 7208, section 8.2).
- Authorize everyone (+all) A plus sign before all authorizes any server on the planet to send for the domain. It shows up by accident in records copied from tutorials, and it is worse than having no SPF.
Why so many SPF records protect nothing
SPF is the oldest of the three records and the one that accumulates the most maintenance: every new service that starts sending on the company's behalf requires a change to it. That is where the two silent defects that explain most cases come in. The first is ending the list with the weak flag: the domain shows up with SPF published in any check, the internal report says the company is compliant, and the forged message still gets delivered, because the weak ending asks nothing of the receiver. Microsoft's documentation goes further: when the message carries no signature either, the DMARC policy ends up ignored on weak-ending failures. That is why the official recommendation is to close with a firm refusal. The second is blowing the query budget: every third-party service added to the record consumes part of the limit of ten, and a company that has accumulated corporate mail, a marketing platform, an invoicing system and a support tool crosses the ceiling without noticing. When that happens the check starts returning a permanent error for the senders sitting at the end of the list, and the domain ends up worse off than before it published the record: on top of not stopping the forgery, it starts taking down part of the company's own legitimate email. In both cases the record exists and does not protect, which is the worst of the situations: the company believes it is covered and it is not. And the second defect charges its price on the other side too: the invoice that never lands, the proposal that vanishes, the campaign that bounces. That cost never shows up on an invoice, it shows up as the customer calling to ask why nothing arrived.
How to publish an SPF record that actually counts
A well-built SPF record is short, single and closed. Getting there takes five steps:
- Inventory every sender firstList everything that sends using the domain, including whatever was bought outside IT: the email marketing tool, the invoicing system, the website form, the document signing service. Whatever is left out will land in spam the moment the list is closed.
- Publish one single record per domainTwo SPF records on the same domain invalidate the check. If there are several services, they all go into the same record, never into separate ones.
- Stay under the ten-lookup ceiling (past it the record returns permerror)Count the terms that require a DNS lookup and keep headroom. If it has overflowed, remove services that no longer send or consolidate the includes, rather than living with a permanent error.
- End with a firm refusal once the inventory is closedThe weak ending is a transition stage, not a destination. It exists for the period when you are still discovering who sends.
- Publish on the subdomains that send tooA subdomain does not inherit the parent domain's SPF. Each sending subdomain needs its own record, and the ones that do not send benefit from a record that authorizes nobody.
In practice
There is an enormous difference between having SPF and being protected by SPF. A record that ends in the weak flag, or that blew the ten-query budget, shows up as present in every checking tool and stops not a single forged message. Checking the ending and the query count takes a minute, and it is what separates the decorative record from the record that acts.
How Zamak handles SPF
Zamak Technologies publishes SPF from the sender inventory, keeps a single record per domain within the query budget, and only closes the list with a firm refusal once measurement shows every legitimate send is passing, alongside whoever already administers the domain. The email spoofing check shows in seconds what your domain's record ends with today. Keeping those records current is part of Managed Email Security and of Managed Cybersecurity in the Zamak Method.