SPF and DKIM for email

SPF and DKIM answer different questions about an email. SPF checks whether a server is authorized to use a sending SMTP domain. DKIM lets the receiver verify a message signature with a public key from DNS.

Check the SPF record

Look for the TXT record starting with v=spf1 for the SMTP sender domain. A common mistake is to add a separate SPF record for each provider. Consolidate permitted senders into one SPF record per DNS name.

SPF limits the number of mechanisms and modifiers that can cause DNS lookups during evaluation to ten. An include can lead to further lookups, so check the chain behind it. Use the values provided by the service that actually sends your mail.

Find the DKIM selector

Read DKIM-Signature in a received test message. The d value identifies the signing domain, and s gives the selector. With d=example.com and s=selector1, the receiver looks up selector1._domainkey.example.com.

The DNS record may hold the key directly or point to the provider through a CNAME. If DKIM fails, check the selector, confirm the intended service is signing, and look for changes made to the message in transit.

Troubleshoot a DMARC failure

Compare the visible From domain with the domain that passed SPF or DKIM. A pass using the provider's own domain counts for DMARC only if that domain also aligns. Test a real message from each important sending service.