Skip to content

    What is SPF?

    SPF, or Sender Policy Framework, is a DNS record that lists which servers are allowed to send email using a domain as the envelope sender. Receiving servers check it to reject or flag messages that come from machines the domain owner never authorized.

    Key points

    • SPF is published as a single TXT record at the sending domain.
    • It checks the envelope sender, also called Return-Path, not the From address the reader sees.
    • A record can trigger at most 10 DNS lookups; going over makes the check fail.
    • SPF alone does not stop spoofing of the visible From address; DMARC ties it to that address.

    How does SPF work?

    When a server receives a message, it looks at the domain in the MAIL FROM command of the SMTP conversation and queries the TXT record of that domain. The record contains mechanisms such as ip4, ip6, a, mx and include, each one describing addresses that may send for the domain.

    The receiver compares the connecting IP with that list. The result can be pass, fail, softfail, neutral, none or an error. The qualifier at the end of the record, usually -all or ~all, tells receivers how strict to be with anything not listed.

    What are the most common SPF mistakes?

    The first is publishing two SPF records for the same domain. The standard allows only one, and two records produce a permanent error.

    The second is exceeding the 10 lookup limit by stacking include statements for every service that sends on behalf of the company. Each include, a, mx and redirect counts, and nested includes count too.

    Why does SPF break with forwarding?

    When a message is forwarded, the forwarding server connects from its own IP but often keeps the original envelope sender. The receiver checks the original domain, does not find the forwarder in the list and records a failure. This is one reason DKIM and ARC exist alongside SPF.

    Example SPF record

    example.com. TXT "v=spf1 ip4:192.0.2.10 mx include:_spf.example.com -all"

    How AHSU 360 handles this

    AHSU 360 checks SPF, DKIM and DMARC on every incoming message before it reaches the mail server, so forged senders are caught at the edge. On outbound mail, partner servers send through the UNODATA relay, which signs with DKIM and applies a limit per account.

    Questions and answers

    Should I use -all or ~all?
    Use ~all while you are still discovering who sends for the domain, then move to -all once every legitimate sender is listed.
    Does SPF protect the From address?
    Not by itself. SPF validates the envelope sender, which the recipient rarely sees. DMARC requires that domain to align with the visible From, which closes the gap.

    Related terms

    Reviewed 22/11/2026 · Email and email security for businesses since 2001.