Skip to content

SPF

noun · also Sender Policy Framework · RFC 7208

An email authentication method that lets a domain publish in DNS which servers may send mail using it as the envelope sender.

Sender Policy Framework (SPF) is a DNS TXT record in which a domain lists the IP addresses and services allowed to send email for it. A receiving server checks the IP address that delivered the message against the record of the domain in the envelope sender (the MAIL FROM or Return-Path address), not the From address the user sees.

The record ends with a rule for everything else: -all (fail), ~all (soft fail) or ?all (neutral).

Example

contoso.com publishes v=spf1 include:spf.protection.outlook.com -all. A message whose envelope sender is @contoso.com, delivered from an IP address outside Microsoft 365, gets spf=fail.

Why it matters for a SOC analyst

SPF alone does not prove who sent a message: an attacker can pass SPF for a domain they own while showing your domain in the From line. Read it together with DKIM and DMARC, and always check which domain it was evaluated for (smtp.mailfrom in the Authentication-Results header).

  • DKIM

    An email authentication method in which the sending domain signs messages with a private key, and receivers verify the signature with a public key in DNS.

  • DMARC

    An email policy that requires SPF or DKIM to pass for a domain aligned with the visible From address, and tells receivers what to do when it does not.

  • Phishing

    A message that impersonates someone trustworthy to trick the recipient into clicking a link, opening a file, sharing credentials or sending money.

  • Business email compromise

    Fraud in which an attacker impersonates or takes over a trusted business email account to redirect payments or obtain sensitive data.