Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

SPF (Shortest Path First)

Direct answer

SPF lists which servers may send mail for a domain in a DNS TXT record, like v=spf1 include:_spf.google.com -all. Receivers check the envelope sender's domain against it.

When to use this

Use this when listing which servers may send mail for your domain.

First 30 seconds

1. SPF lists IPs allowed to send for a domain.

2. End with -all (softfail only during rollout).

3. Max 10 DNS lookups.

4. Checks envelope sender (MAIL FROM), not the visible From.

5. Needs DMARC for alignment.

Operational verification

receiving server → SPF record → sender IP allowed?

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • More than 10 DNS lookups (include, a, mx, redirect) → permerror, SPF fails.
  • Two SPF records on the same name → permerror.
  • +all or ?all, which authorise everyone.
  • Forgetting third-party senders (CRM, newsletter, ticketing).
  • Expecting SPF to protect the visible From header — it checks the envelope sender; DMARC ties them together.
Platform / version applicability
Security architecture and operations
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformSecurity architecture and operations
Scope / prerequisiteUse this when listing which servers may send mail for your domain.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Only one SPF record per domain.
  • Stay under 10 DNS lookups.
  • End with -all (fail) or ~all (softfail).
Key checks
  • dig TXT <domain> +short | grep v=spf1 — SPF record
  • SPF lookup count (≤ 10) — limit
  • SPF result in message headers (Received-SPF) — evaluation
ReferenceWhy it matters1 section · depth on demand

Writing SPF records

example.com. TXT "v=spf1 ip4:203.0.113.25 include:spf.protection.outlook.com include:_spf.google.com -all"
  • Only one SPF record per domain.
  • Maximum 10 DNS lookups (include, a, mx, redirect); exceeding it gives permerror.
  • -all = fail, ~all = softfail; DMARC decides the final action.
  • SPF checks the envelope sender (Return-Path), not the visible From — DMARC alignment connects them.
ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

SPF (Sender Policy Framework) publishes in DNS which servers may send email for a domain. Receivers check the connecting server's IP against the SPF record of the envelope sender (Return-Path) domain.

example.com. TXT "v=spf1 include:spf.protection.outlook.com include:_spf.mailprovider.example ip4:203.0.113.25 -all"

Documented example, not captured output.

QualifierMeaning
-allFail everything else (recommended once complete)
~allSoft fail
?allNeutral — no protection

Limits: a maximum of 10 DNS lookups per evaluation (exceeding it causes permerror), and SPF checks the envelope sender, not the visible From address — DMARC provides that alignment. Inventory every service sending as your domain before tightening the record.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docSecurity architecture and operations current

Authoritative/upstream documentation reviewed for bounded claims in Email Security → SPF. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc7489 · confidence 94%
Confirmation

Confirm action

Continue?