Webiano Digital & Marketing Agency
Webiano Digital & Marketing Agency
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Menu
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Home » Knowledge base » Internet » Email infrastructure » SPF

SPF

5 min read · 7 sections

In short

SPF is an email authentication method in which a domain publishes in DNS which servers may send its mail, letting receivers detect forged senders.

On this page 7
  1. How an SPF check works
  2. SPF mechanisms and qualifiers
  3. SPF compared with DKIM and DMARC
  4. Publishing and maintaining an SPF record
  5. Limitations and common mistakes
  6. Understanding it simply
  7. Applied in practice

SPF (Sender Policy Framework) is an email authentication standard in which a domain owner publishes a DNS TXT record listing the servers authorized to send mail for that domain. In email infrastructure, receiving mail servers compare the IP address of the connecting server with that list and use the result to judge whether a message is likely forged. The current specification is RFC 7208.

SPF addresses one specific weakness of SMTP: the protocol itself lets any server claim any sender address. SPF does not stop that claim, but it gives receivers a verifiable policy to check it against, and it forms one of the three pillars of modern sender authentication together with DKIM and DMARC.

How an SPF check works

During an SMTP session the sending server announces an envelope sender with the MAIL FROM command, also called the return path or bounce address. The receiver takes the domain of that envelope sender, looks up its TXT record beginning with v=spf1, and evaluates the mechanisms from left to right against the client IP address. The first mechanism that matches decides the result.

When the envelope sender is empty, as with bounce messages, the receiver checks the domain given in the HELO or EHLO greeting instead. A typical record looks like v=spf1 ip4:192.0.2.0/24 include:_spf.example.net -all, which authorizes one address block plus the servers of a provider and rejects everything else.

The evaluation ends with one of several defined results. The table below lists them and the usual receiver reaction.

ResultMeaningTypical receiver handling
PassIP is authorizedPositive signal, not proof of legitimacy
FailIP is explicitly not authorizedReject or strong spam signal
SoftfailIP probably not authorizedAccept but mark as suspicious
NeutralDomain makes no assertionTreated like no policy
NoneNo SPF record foundNo SPF signal available
TemperrorTemporary DNS problemDefer and retry later
PermerrorRecord cannot be evaluatedOften treated as fail by DMARC
SPF evaluation results

SPF mechanisms and qualifiers

An SPF record consists of mechanisms that describe sets of addresses and optional qualifiers that say what a match means. The default qualifier is +, meaning pass. The closing all mechanism catches every address not matched earlier and therefore defines the policy for unknown senders.

MechanismWhat it matchesDNS lookup cost
ip4 and ip6A literal address or CIDR blockNone
aAddresses in the domain’s A or AAAA recordsOne lookup
mxAddresses of the domain’s mail exchangersOne lookup plus per-host lookups
includeResult of another domain’s SPF recordOne lookup plus nested ones
existsAny IP if a constructed name resolvesOne lookup
allEvery addressNone
Common SPF mechanisms

The qualifiers are + pass, - fail, ~ softfail and ? neutral. A record ending in `-all` is a strict policy, while `~all` is a cautious policy often used during rollout. The ptr mechanism is deprecated because it is slow and unreliable and should not be used in new records.

SPF compared with DKIM and DMARC

SPF authenticates the sending path, not the message content and not the address a reader sees. That gap is why it works best alongside DKIM and DMARC, each of which covers a different part of the problem.

StandardWhat it verifiesIdentity checkedSurvives forwarding
SPFSending server is authorizedEnvelope sender domainUsually not
DKIMMessage was signed and not alteredSigning domain in d= tagUsually yes
DMARCVisible From domain aligns with SPF or DKIMHeader From domainDepends on DKIM
Roles of the three sender authentication standards

The visible From address is the critical point. SPF can pass for a bounce domain belonging to a newsletter provider while the From header shows a bank. Only DMARC alignment ties an SPF pass to the domain the recipient actually reads.

Publishing and maintaining an SPF record

Each domain may publish exactly one SPF record; two v=spf1 records produce a permerror. Start by listing every system that sends mail with the domain in the envelope sender: the main mail server, marketing platforms, ticketing systems, invoicing software and cloud services. Domains that never send mail should publish `v=spf1 -all` to make spoofing them less attractive.

SituationRecommended record endingReason
Initial rollout with unknown senders~allLimits damage from a missed sender
Inventory complete and monitored-allClear signal against forged mail
Domain that sends no emailv=spf1 -allDeclares that no server is authorized
Many third-party sendersSubdomains per serviceKeeps each record within lookup limits
Typical SPF policy choices

Limitations and common mistakes

The most frequent technical failure is the limit of 10 DNS lookups per evaluation. Every include, a, mx, exists and redirect counts, including nested ones, and exceeding the limit yields a permerror that receivers may treat as failure. A second limit of two void lookups catches records that point at names that no longer exist.

  • Forwarding breaks SPF, because the forwarding server is not in the original domain’s record; SRS rewriting or DKIM must cover this case.
  • SPF alone does not protect the From header, so it cannot stop display spoofing without DMARC.
  • Overly broad entries such as large provider ranges or +all effectively authorize strangers.
  • Flattening includes into IP lists avoids the lookup limit but goes stale when providers change addresses.
  • Forgotten senders such as a new billing tool cause legitimate mail to fail after -all is enforced.

Understanding it simply

Imagine a company that posts a public list at its front gate naming the only couriers allowed to deliver parcels in its name. Anyone receiving a parcel that claims to come from the company can check whether the courier is on that list.

SPF is that list for email. A domain writes down which mail servers may send for it, and receiving servers check each incoming message against it. It does not prove that a message is honest, and it does not check the sender name a person sees, but it makes simple forgery easier to spot.

Applied in practice

An online shop sends order confirmations from its own server, newsletters through a marketing platform and invoices through an accounting service. Customers report phishing emails that pretend to come from the shop. The administrator publishes one record containing ip4:203.0.113.10 plus an include entry for each of the two services, and ends the record with ~all while monitoring DMARC reports for two weeks.

The reports reveal one forgotten sender, a support desk tool, which is added. The record now needs seven DNS lookups, safely under the limit, so the ending is changed to -all. Combined with DKIM signing and a DMARC policy of quarantine, forged messages using the shop’s domain are now filtered by major mailbox providers, while legitimate mail continues to arrive.

Published November 9, 2026

Filed under

  • Internet

    Subject

  • Email infrastructure

    Topic

Growth is engineered, not improvised.

All rights reserved © 2002–2026 | Webiano Digital & Marketing Agency

Social Media

  • Facebook
  • LinkedIn
  • YouTube

GDPR, Privacy and Cookies Policy

Copyright and Content Use Policy

Webiano Code of Ethics

  • Slovakia
  • Czechia
  • Europe
  • Global

Daily News & Insights via RSS