Prompt
How do I check if SPF or DKIM is broken?
Latest observation
To check whether SPF or DKIM is broken, the quickest approach is to inspect the email headers of a message that was sent from your domain and see whether the receiving server reported pass or fail.
1) Check the message headers
Open a delivered email and look for lines like:
- SPF
Received-SPF: pass- or in authentication results:
spf=passspf=fail
- DKIM
dkim=pass- or
dkim=fail
- Often bundled in:
Authentication-Results:
Example:
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of user@example.com designates 1.2.3.4 as permitted sender)
dkim=pass header.i=@example.com
dmarc=pass
If you see fail, softfail, neutral, temperror, or permerror, that points to a problem.
2) Use a mail testing service
Send a test email to a service like:
- mail-tester.com
- Gmail / Outlook test inboxes
- Your ESP’s built-in validation tools
These services will show:
- whether SPF passed
- whether DKIM passed
- whether DMARC passed
- common configuration issues
3) Verify SPF in DNS
SPF is a TXT record on your domain.
Check it with:
dig TXT example.com
Look for something like:
v=spf1 include:_spf.google.com ~all
Things to check:
- only one SPF record per domain
- includes all sending services
- not too many DNS lookups
- sender IP is authorized
- record syntax is valid
4) Verify DKIM in DNS
DKIM uses a selector and public key in DNS.
Example lookup:
dig TXT selector._domainkey.example.com
You should see a record like:
v=DKIM1; k=rsa; p=MIIBI...
Things to check:
- selector matches what your mail server uses
- public key exists in DNS
- DKIM signature is being added to outgoing mail
- key hasn’t been rotated/removed
5) Common signs it’s broken
SPF broken if:
- the sending IP is not in the SPF record
- you have multiple SPF TXT records
- the record exceeds DNS lookup limits
- forwarded mail fails SPF
Return-Pathdomain doesn’t align with the sending service setup
DKIM broken if:
- the DKIM signature is missing
- the selector DNS record is missing
- the message was modified after signing
- the private key on the sender is wrong
- the signature is invalid or expired
6) Fast troubleshooting commands
If you have terminal access:
dig TXT example.com
dig TXT selector._domainkey.example.com
For a full header check, copy the email headers into a parser like:
- MXToolbox header analyzer
- Google header analyzer tools
- mail-tester
7) If you want the shortest answer
- SPF: check the domain’s TXT record and the message’s
spf=pass/fail - DKIM: check the selector TXT record and the message’s
dkim=pass/fail
If you want, I can help you interpret a specific email header or SPF/DKIM DNS record.