tamper[box]

Sender Policy Framework (SPF) lookup and validator

Diagnose SPF lookup errors

SPF permerror, or too many DNS lookups? Count every lookup your record costs and see what to flatten.

Sender Policy Framework is a DNS policy in which a domain owner identifies the mail servers and IP ranges allowed to send using that domain. During delivery, the receiving server checks the connecting IP against the policy for the envelope sender domain, which is usually shown later as Return-Path. SPF does not authenticate the visible From address by itself; DMARC adds the alignment check that protects it. Jump to: What does it mean?, How to fix it, Break it, Ask your agent.

Live default tamperbox.dev is looked up live when the page opens. Replace it to check another domain.

Ready to look up tamperbox.dev.

Enable JavaScript to run the live lookup.

    A pasted record is read in your browser. Only the include and redirect names it contains are looked up from our server; the record itself is never uploaded.

    A domain means DNS lookups from our server. One TXT lookup per include and redirect, through public DNS. Nothing you enter is saved.

    Findings

    1 problem
    • Fail 11 of 10 DNS lookups

      An evaluation that reaches an eleventh DNS-dependent term returns permerror. Earlier matches can pass; this is a static expansion, not a sender test.

    • Pass Ends in ~all

      Unlisted servers soft-fail; DMARC decides what happens.

    Lookup budget

    No empty TXT lookups; address lookups not tested

    11of 10 lookups

    1. 1inc
    2. 2inc
    3. 3inc
    4. 4inc
    5. 5inc
    6. 6inc
    7. 7inc
    8. 8a
    9. 9mx
    10. 10inc
    11. 11inc

    An evaluation reaching lookup 11 stops there. Earlier matching mechanisms can finish sooner.

    Include tree

    Static include and redirect expansion
    1. harbor-supply.example11 lookups in total

      v=spf1 include:_spf.inboxcloud.example include:send.bulkpost.example include:mail.ticketdesk.example include:spf.officesuite.example ip4:198.51.100.24 ~all

      1. include:_spf.inboxcloud.example4 lookups with what it includes

        v=spf1 include:_nb1.inboxcloud.example include:_nb2.inboxcloud.example include:_nb3.inboxcloud.example ~all

        1. include:_nb1.inboxcloud.example1 lookup with what it includes

          v=spf1 ip4:203.0.113.0/26 ip4:203.0.113.64/27 ip6:2001:db8:10::/48 ~all

        2. include:_nb2.inboxcloud.example1 lookup with what it includes

          v=spf1 ip4:192.0.2.0/27 ip6:2001:db8:11::/48 ~all

        3. include:_nb3.inboxcloud.example1 lookup with what it includes

          v=spf1 ip4:192.0.2.128/26 ~all

      2. include:send.bulkpost.example2 lookups with what it includes

        v=spf1 ip4:198.51.100.128/25 include:relay.bulkpost.example ~all

        1. include:relay.bulkpost.example1 lookup with what it includes

          v=spf1 ip4:198.51.100.200/29 ~all

      3. include:mail.ticketdesk.example3 lookups with what it includes

        v=spf1 a:smtp.ticketdesk.example mx ~all

      4. include:spf.officesuite.example2 lookups with what it includes

        v=spf1 ip4:203.0.113.128/25 include:spf2.officesuite.example -all

        1. include:spf2.officesuite.example1 lookup with what it includes

          v=spf1 ip6:2001:db8:20::/44 -all

    Flattening plan

    11 → 7 lookups

    Flatten only what you must. Replacing 1 include with the address ranges it publishes today brings the record to 7 lookups. Everything else stays an include, so it keeps following the provider.

    • Flatten_spf.inboxcloud.exampleFlatten: saves 4, 6 ranges
    • Keepmail.ticketdesk.exampleKeep: uses a, mx or exists
    • Keepsend.bulkpost.exampleKeep: 2 lookups
    • Keepspf.officesuite.exampleKeep: 2 lookups

    Flattened record

    "v=spf1 ip4:203.0.113.0/26 ip4:203.0.113.64/27 ip6:2001:db8:10::/48 ip4:192.0.2.0/27 ip6:2001:db8:11::/48 ip4:192.0.2.128/26 include:send.bulkpost.example include:mail.ticketdesk.example include:spf.officesuite.example ip4:198.51.100.24 ~all"

    240 characters in 1 TXT string. Ranges copied today: check them again whenever a provider announces new ones.

    The record, term by term

    155 characters
    Show every term 6 terms
    include_spf.inboxcloud.exampleAlso allow the senders another domain lists. Costs 1 lookup
    includesend.bulkpost.exampleAlso allow the senders another domain lists. Costs 1 lookup
    includemail.ticketdesk.exampleAlso allow the senders another domain lists. Costs 1 lookup
    includespf.officesuite.exampleAlso allow the senders another domain lists. Costs 1 lookup
    ip4198.51.100.24An IPv4 address or range
    softfail all~allEverything not matched earlier

    Take it further

      What this result means

      Run a check to see what the result means.

        • One include per service that sends for you; remove the include when the contract ends.
        • Prefer a subdomain with its own record for a bulk sender, so its lookups never count against the main domain.
        • Flatten only includes that publish plain address ranges, and re-check them after the provider announces changes.
        • End in ~all while DMARC is being rolled out, -all once every sender is listed.
      • Flattened ranges are a copy of what a provider publishes today; they go stale when the provider changes them.

        Nothing you enter is stored.

      How it works

      Enter a domain and our server reads its SPF record from public DNS, then follows every include and redirect the same way, one TXT lookup each, so the count covers what a receiver would read. Paste a record and it is parsed in your browser; only the names it includes are looked up. The result numbers every lookup in evaluation order against the limit of 10, draws the include tree, lists every syntax and hygiene problem with its fix, and proposes a flattening plan that replaces only the includes it must.

      The full method, every rule and worked examples are on docs.tamperbox.dev.

      Limits and interpretation

      The count is a bounded static expansion, not an SPF evaluation for a sender address: a real receiver stops at the first matching mechanism, so mail matched early can pass a record that is over the limit. The targets of a, mx and exists are not resolved, macros are not expanded, and expansion stops after 100 names or ten levels of nesting. Flattened ranges are a snapshot of what a provider publishes today and go stale when the provider changes them. Nothing you enter is stored.

      Frequently asked questions

      What causes SPF PermError: too many DNS lookups?

      An SPF evaluation that exceeds the limit of 10 lookup-causing terms returns a permanent error. Nested includes can consume the budget even when the top-level record looks short.

      Does an SPF lookup count prove a sender will pass?

      No. This tool estimates a bounded static expansion, without evaluating a sender IP. Real evaluation can stop at an earlier match; unsupported branches remain incomplete.

      Is SPF flattening a permanent fix?

      No. Flattening replaces compatible includes with current address ranges. Those ranges need maintenance when the provider changes them; review the proposed record before publishing.

      References

      Sender Policy Framework: RFC 7208 (Proposed Standard, updated by RFC 7372, RFC 8553 and RFC 8616). The lookup and void-lookup limits follow section 4.6.4; the evaluation order follows section 4.6.2, section 5.1 and section 6.1.

      Are you an AI agent? You are in the right place.

      This page and every tool are available as plain text with their methods and limits, and the same checks run over MCP.