What are the seven results an SPF check can return, and how does a receiving mail server typically handle each one?
answer
- the sender states, the receiver decides
- three verdicts, two non-answers, two errors
- neutral handled exactly like none
- softfail alone is no reason to reject
- 451 for transient, 550 for permanent
basics
~20 sSPF returns pass, fail, softfail, neutral, none, temperror or permerror. RFC 7208 leaves the action to the receiver: it may reject fail, should not reject on softfail alone, must treat neutral like none, and may defer temperror.
solid answer
~50 sAn SPF check compares the connecting IP address with the policy published by the `MAIL FROM` (or `HELO`) domain and returns one of seven results. `pass` means the IP is authorized; `fail` is an explicit statement that it is not; `softfail` is a weaker "probably not". `neutral` means the domain chose to assert nothing, and `none` means there was no usable domain or no SPF record. `temperror` is a transient, usually DNS, error; `permerror` means the record could not be interpreted. RFC 7208 sets almost no handling rules: a receiver may reject `fail` with `550`, SHOULD NOT reject on `softfail` alone, MUST treat `neutral` exactly like `none`, may defer `temperror` with `451`, and may reject `permerror` with `550`. When it accepts a message, it should record the result in a header field for later filters.
go deeper
Recall all seven names and one line each: pass and fail are firm statements, softfail is a weak one, neutral and none say nothing, and the two errors are transient or permanent.
Explain that RFC 7208 leaves handling to receiver policy, then give the guidance per result: neutral equals none, softfail is not grounds alone for rejection, fail may be rejected with 550.
Show operating judgment: what your receiver does with fail and softfail, why accepted mail gets a recorded result, and how forwarding produces fail for legitimate mail.
Frame SPF results as one signal in a layered decision: what rejecting at the SMTP stage costs in false positives against what delivering unauthorized mail costs your users.
## What an SPF check produces **Sender Policy Framework** (SPF, RFC 7208, April 2014) lets a domain publish, in a `v=spf1` TXT record, which hosts may send mail using that domain in the SMTP envelope. A receiving mail server runs the evaluation the RFC calls `check_host()` with three inputs: the **IP address of the connecting client**, the **domain** being checked (from `MAIL FROM`, or from `HELO`/`EHLO`), and the sender address. The output is always exactly one of seven named results. The important design choice is in section 2.6: the protocol "establishes no normative requirements for handling any particular result." The domain owner makes a statement; the **receiver's local policy** decides what to do with it. Section 8 then offers guidance per result, and it contains only one MUST: `neutral` MUST be treated exactly like `none`. ## The seven results | Result | What it means | Handling RFC 7208 section 8 suggests | |---|---|---| | `none` | No usable domain could be taken from the session, or the domain publishes no SPF record (a name that does not exist also gives `none`) | No information at all; carry on as if SPF were absent | | `neutral` | A record exists but the domain explicitly declines to say whether this IP is authorized | MUST be treated exactly like `none` | | `pass` | The client is authorized to use the domain in this identity | The domain can, in the sense of reputation, be held responsible for the message; further checks proceed with confidence in that identity | | `fail` | An explicit statement that the client is **not** authorized | Local policy: reject in the transaction with `550` and `5.7.1` (RFC 7372 later registered `5.7.23` for this), or accept and record the result | | `softfail` | A weak statement that the host is **probably not** authorized | SHOULD NOT reject based solely on this result; MAY apply closer scrutiny | | `temperror` | A transient, generally DNS, error during the check; a retry may succeed | Accept, or temporarily reject with `451` and `4.4.3` | | `permerror` | The domain's records could not be interpreted; a DNS operator must fix them | Reject with `550` and `5.5.2`, or accept with an annotation | ## Two classes of handling Whatever the result, a receiver has essentially two kinds of response (section 8): 1. **Act inside the SMTP session** that is delivering the message: a permanent rejection (a `5xx` reply) or a temporary one (a `4xx` reply that asks the sender to try again later). 2. **Accept the message** with a success reply and add a header field, `Received-SPF` or `Authentication-Results`, that records the result for downstream processors such as content filters, a DMARC evaluator or the mail client. RFC 7208 says that a receiver which does not reject SHOULD add that header field, and that this matters most for `fail`, because the message is explicitly not authorized by the domain. Section 11.7 adds a warning: an operator who delivers `fail` mail is admitting content the purported sender has disowned. Receivers genuinely differ. Some treat `fail`, and sometimes `softfail`, as definitive and reject. Others only record the result. Many use SPF as one input among several. Section 10.2 explains why caution is reasonable: SPF can return `pass` for harmful mail (a spammer can publish a correct record for a throwaway domain) and `fail` for legitimate mail that passed through a forwarding alias. ## Reading the results in pairs Most interview confusion disappears when the results are compared two at a time: - **`pass` against `fail`** are both explicit statements by the domain owner. Neither says anything about the message content or about the `From` header the reader sees. - **`fail` against `softfail`** differ in the strength of the owner's statement. `softfail` exists so a domain can say "probably not" without asking receivers to reject; RFC 7208 suggests it might lead to a flag in the mail client or greylisting rather than a refusal. - **`neutral` against `none`** differ only in whether a record exists. The distinction is informational, and section 8.2 explains the MUST: treating `neutral` more harshly would discourage domains from testing SPF. - **`temperror` against `permerror`** differ in who must act. A `temperror` may clear on its own when DNS recovers; a `permerror` persists until the domain's DNS operator corrects the record. ## What a pass does and does not prove - It proves the connecting IP is authorized for the **envelope domain** (or HELO name) that was checked, nothing more. - It does not authenticate the visible `From` header; connecting that header to SPF is what DMARC alignment adds, which is covered with DMARC. - It does not make the message safe: reputation and content checks still apply. - A result is tied to one hop, so mail that passes at the first receiver can fail at a later one after forwarding. ## In practice A mail administrator usually meets these results in logs and in the recorded result field of a delivered message. The working habit is to ask two questions of any result: what did the domain owner state, and what did this receiver's policy choose to do with that statement. Keeping those two apart is exactly what RFC 7208 does.
- Why does RFC 7208 insist that neutral be treated exactly like none?Section 8.2 makes it a MUST so that domains can publish a record that asserts nothing while they work out their sending infrastructure. If receivers punished `neutral` more than having no record at all, domains would be discouraged from deploying and testing SPF. The difference is kept only for information: `neutral` tells you a record exists.
- If a receiver accepts a message whose SPF check returned fail, what should it do?RFC 7208 section 8.4 says it SHOULD add a `Received-SPF` or `Authentication-Results` header field so downstream processors, such as spam filtering, a DMARC evaluator or the mail client, can act on the result. Section 11.7 warns that delivering `fail` mail admits content the purported domain explicitly did not authorize, so it deserves extra scrutiny.
- Which SMTP replies does RFC 7208 suggest when a receiver does reject on an SPF result?For `fail`, `550` with enhanced code `5.7.1`; RFC 7372 (September 2014) registered `5.7.23` "SPF validation failed" for use in its place. For `temperror`, `451` with `4.4.3`, and for `permerror`, `550` with `5.5.2`; RFC 7372's `X.7.24` "SPF validation error" can replace those two.
- Softfail means the receiver must reject the message.
- Neutral should be scored more harshly than having no SPF record.
- An SPF pass proves the visible From address is genuine.
- RFC 7208 requires receivers to reject every SPF fail.
- Temperror and permerror both mean the sender's record has a typo.