Home/Glossary/SPF (Sender Policy Framework)

SPF (Sender Policy Framework)

Email authentication method that specifies which mail servers are authorized to send email on behalf of your domain.

Email SecurityAlso called: "Sender Policy Framework", "SPF record"

SPF is a DNS-based authentication mechanism that helps prevent email spoofing by allowing domain owners to publish a list of authorized sending IP addresses and mail servers.

Why it matters

  • Prevents spammers and attackers from sending emails that appear to come from your domain.
  • First line of defense against email spoofing and domain impersonation.
  • Required by most email providers for optimal deliverability.
  • Works together with DKIM and DMARC for comprehensive email security.
  • Protects your domain reputation and prevents blacklisting.

How it works

  • Published as a TXT record in your domain's DNS: v=spf1 include:_spf.google.com ~all
  • Receiving servers check if the sending IP is listed in your SPF record.
  • SPF result (pass, fail, softfail, neutral) is used by DMARC for policy enforcement.
  • Supports mechanisms: ip4, ip6, a, mx, include, and all.
  • Allows up to 10 DNS lookups to prevent abuse and performance issues.

How to implement

  • Identify all legitimate email sources (mail servers, marketing platforms, CRM systems).
  • Create SPF record starting with v=spf1 and listing authorized sources.
  • Use "include:" for third-party services (Google Workspace, Microsoft 365, SendGrid).
  • End with ~all (softfail) for testing or -all (fail) for strict enforcement.
  • Monitor for SPF lookup limit (10 maximum) and use SPF flattening if needed.
  • Test with email authentication tools before deploying.