In SPF (Sender Policy Framework) records, qualifiers determine how receivers should treat mechanisms that match. The two SPF records you mentioned are functionally equivalent:
v=spf1 +a +mx -all
v=spf1 a mx -all
Both records will:
- Pass (+ qualifier) if the sending IP matches the domain's A record
- Pass (+ qualifier) if the sending IP matches the domain's MX record
- Fail (- qualifier) all other cases
The key thing to understand is that the +
qualifier is the default. When you omit the qualifier (like in the second example), SPF assumes +
. This is defined in RFC 7208.
While both forms are valid, explicit qualifiers can improve readability and prevent confusion:
# More readable with complex policies
v=spf1 +a +mx ~ip4:192.0.2.0/24 -all
# Helps distinguish between different qualifiers
v=spf1 +a ~mx ?include:_spf.example.com -all
Here's a quick reference of SPF qualifiers:
Qualifier | Result | Description |
---|---|---|
+ | Pass | Explicit pass (default) |
- | Fail | Explicit fail |
~ | SoftFail | Between neutral and fail |
? | Neutral | No policy statement |
When creating SPF records:
- Keep them under 10 DNS lookups (includes, mx, ptr, etc.)
- Always end with
-all
or~all
- Use explicit qualifiers when mixing different types
- Test your SPF record using tools like MXToolbox
# Example of a well-formed SPF record
v=spf1 +a +mx +ip4:192.0.2.1 include:_spf.google.com -all
Remember that SPF records are just one part of email authentication. You should also implement DKIM and DMARC for complete protection.
In SPF (Sender Policy Framework) records, qualifiers determine how mechanisms should be processed. The four possible qualifiers are:
+
Pass (default, implicit)-
Fail~
SoftFail?
Neutral
Both of these SPF records are functionally identical:
v=spf1 +a +mx -all
v=spf1 a mx -all
The +
sign is the default qualifier, so explicitly including it (as in the first example) has the same effect as omitting it (second example).
Early SPF implementations required explicit qualifiers. Modern SPF parsers handle both formats, making the explicit +
optional for the Pass case.
While functionally equivalent, there are subtle considerations:
- Readability: Some administrators prefer explicit qualifiers for clarity
- Compatibility: Extremely old SPF implementations (pre-2006) might require explicit
+
- Tooling: Some SPF validation tools normalize records by removing redundant
+
signs
These SPF records all achieve the same policy:
# Explicit qualifiers
v=spf1 +ip4:192.0.2.0/24 +include:example.com -all
# Implicit qualifiers
v=spf1 ip4:192.0.2.0/24 include:example.com -all
# Mixed style
v=spf1 +ip4:192.0.2.0/24 include:example.com -all
- Choose one style and use it consistently across your organization
- Consider your team's preference for explicit vs implicit notation
- When in doubt, omitting the
+
is more common in modern SPF records
While the +
is optional for Pass, it's required for other qualifiers:
# Correct
v=spf1 ?ip4:203.0.113.1 ~all
# Incorrect (syntax error)
v=spf1 ? ip4:203.0.113.1 ~ all
Note that spaces after qualifiers will cause parsing errors.