What is SPF?

SPF (Sender Policy Framework) is an email authentication method that helps prevent spammers from sending emails on behalf of your domain.

How SPF Works

SPF works by allowing domain owners to publish a list of IP addresses and servers that are authorized to send email for their domain. When an email server receives a message, it checks the SPF record to verify if the sending server is authorized.

The SPF Check Process

  1. 1Email is sent from a mail server
  2. 2Receiving server extracts the domain from the envelope sender
  3. 3Server looks up the SPF record in DNS for that domain
  4. 4Server checks if the sending IP matches the authorized list

SPF Results

Pass

The sending IP is authorized. The email is legitimate.

Fail

The sending IP is explicitly not authorized. The email may be rejected.

Softfail

The IP is probably not authorized, but the domain owner is not certain. Usually accepted but marked.

Neutral / None

No SPF record exists or the record doesn't make a statement about the IP.

Example SPF Record

v=spf1 include:_spf.google.com include:amazonses.com ip4:192.0.2.0/24 -all

This record authorizes Google Workspace, Amazon SES, and a specific IP range to send email for the domain. The -all means all other sources should fail.

Common SPF Mechanisms

  • include: - Include another domain's SPF record
  • ip4: - Authorize a specific IPv4 address or range
  • ip6: - Authorize a specific IPv6 address or range
  • a - Authorize the domain's A record IP
  • mx - Authorize the domain's mail servers
  • -all - Fail all other sources (hard fail)
  • ~all - Softfail all other sources

Why SPF Matters

  • Prevents email spoofing and phishing attacks
  • Improves email deliverability
  • Required for DMARC compliance
  • Builds sender reputation

Check Your SPF Configuration

Use our free spam checker to verify your SPF, DKIM, and DMARC settings.

Check Your Email

Need SPF verification in your app?

Mailhooks automatically verifies SPF, DKIM, and DMARC for every inbound email and delivers the results via webhook.

Try Mailhooks free