Choose the right SPF ending for this domain
Why it matters
A domain that sends no mail should publish -all so spoofed mail claiming to come from it is rejected outright. A domain that does send mail can keep ~all while DMARC enforces; -all is the stricter option once every sender is listed.
Staged change. Do this in stages and check each one before the next, so a mistake does not break your site or your mail.
The fix
- If this domain sends no mail (no MX, or a null MX, and no sending service), replace the whole record with v=spf1 -all. Also publish DMARC p=reject (see the DMARC fix) and, only if no mailbox uses this domain, a null MX (MX priority 0, target a single dot); this is safe because nothing legitimate is sent.
- If it does send mail, ~all is fine while a DMARC policy of quarantine or reject is in place. Change to -all only after DMARC reports show all legitimate senders pass SPF; note that -all can cause forwarded mail to be rejected before DMARC is considered.
dns
; Domain that sends no mail example.com. IN TXT "v=spf1 -all" ; Only if no mailbox uses this domain, also publish a null MX (RFC 7505) ; example.com. IN MX 0 .
The examples use example.com. Replace it with your own domain.
Related
- Reported by the SPF record check
- Publish an SPF record
- Merge the SPF records into one
- Fix the syntax error in the SPF record
- Replace +all in the SPF record with ~all
- Narrow the very large address range in the SPF record
- Change ?all in the SPF record to ~all
- End the SPF record with ~all or -all
- Bring the SPF record under 10 DNS lookups
- Leave room under the SPF lookup limit
- Remove SPF terms that point at names that no longer exist
- Fix the SPF include that has no SPF record
- Break the loop in the SPF includes
- Replace the include that has several SPF records
- Replace the ptr mechanism in the SPF record
- Check the SPF terms that use macros
- Re-run the scan if part of the SPF record could not be read
Scan your domain to see whether this applies to you.