Skip to main content
Security Auditor — looks up the TXT records of the audited domain and checks that exactly one of them is an SPF record (v=spf1 …) ending with a strict terminal mechanism (-all or ~all).

Protection

Stops other people from sending email that claims to come from your domain and keeps your real mail out of the spam folder.

Standards

Follows RFC 7208, Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1.
SPF is a TXT record published at a domain that names the servers allowed to send email for it. Receiving mail servers look the record up for every message that claims to come from the domain and use its terminal mechanism (-all, ~all, ?all or +all) to decide what to do with a message from a server that is not listed. This auditor reads the SPF record of the domain behind the audited URL and checks that it exists, that there is exactly one, and that it ends in a way that actually limits who can send.

How it works

  1. Domain — takes the host of the audited URL and strips one leading www. (https://www.example.com/page is audited as example.com). A URL without a host ends the audit with 501. The auditor never fetches the page.
  2. Lookup — asks DNS for the TXT records of the domain. A lookup that cannot complete (SERVFAIL, timeout) ends the audit with 500; it is not reported as a missing record.
  3. Select — keeps the TXT records that start with v=spf1 (any letter case). None is a FAIL (400); more than one is a FAIL (401), because RFC 7208 treats several records as a permanent error.
  4. Terminal mechanism — splits the single record on whitespace and takes its first all term (with any qualifier -, ~, ?, + or none), or, when there is no all, its first redirect= modifier. +all or a bare all fails (402); no terminal at all warns (300); the neutral ?all warns (301).
  5. Length — a record longer than 450 UTF-8 bytes warns (302), because the TXT answer is about to outgrow a 512-byte UDP packet.
  6. Aggregate — FAIL wins over WARNING; when every rule passes the audit is SUCCESS (200) and the message quotes the record.
  7. Specification pin — every run emits 37A-DnsMailSpfAuditor-100 (INFORMATION), naming RFC 7208, Sender Policy Framework (April 2014). It does not change the overall status.

What it audits

Every row maps to one checkRule* method and one CheckCode, in the order the auditor runs them. CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error.

Output documentation

Every check carries domain, txtRecords, spfRecords, spfRecord, recordCount, terminalMechanism and recordBytes in its data, so the record the verdict was taken from is visible in the report.

Risks and considerations

Why SPF matters

  • Without SPF, or with a record that passes everyone, phishing campaigns can send email as your domain and receivers cannot tell it from your real mail; DMARC also cannot be enforced without SPF or DKIM.
  • A broken record (several records, an oversized answer) is worse than none for deliverability: receivers return a permanent error and may reject your legitimate mail.

-all, ~all, ?all, +all

  • -all (fail) asks receivers to reject unlisted senders; ~all (softfail) asks them to accept but mark the message, and is the usual first step while you confirm every legitimate sender is listed.
  • ?all (neutral) and +all (pass) give no protection. redirect=other.example hands the whole evaluation to another domain’s record and counts as a terminal; that other record is not followed by this auditor.
  • The auditor reads the first all term in the record; RFC 7208 ignores anything after it.

What changed in this version

  • +all (and a bare all) now fails with 402; the previous version only warned.
  • The two “no terminal mechanism” warnings no longer fire together: a record with no all warns once with 300, a record with ?all warns once with 301.
  • A redirect= modifier now counts as a terminal mechanism instead of warning.
  • A URL without a hostname is an ERROR (501) instead of a FAIL.
  • A DNS lookup that cannot complete is an ERROR (500) instead of a “missing SPF record” FAIL.

What this auditor does not check

  • It does not evaluate the mechanisms themselves: include: chains, the 10-lookup limit, a/mx/ip4/ip6 validity or whether the listed hosts really send your mail.
  • It only looks at the domain of the audited URL (minus one www.), not at subdomains used for mail.
  • DKIM and DMARC have their own auditors.