What is SPF?
SPF (Sender Policy Framework) is an email authentication protocol that allows domain owners to specify which mail servers are authorized to send email on behalf of their domain. It works through DNS TXT records that list authorized IP addresses and servers, helping receiving servers detect forged sender addresses.
How SPF Works
SPF uses DNS records to define authorized senders:
1. Record Publishing: Domain owner adds a TXT record listing authorized mail servers
- Email Sending: Mail is sent from a server
- SPF Check: Receiving server looks up the SPF record for the sender's domain
- Verification: Server checks if the sending IP is authorized
- Result: Pass, fail, softfail, or neutral based on the policy
Example SPF record:
``
v=spf1 include:_spf.google.com include:sendgrid.net ~all
This allows Google and SendGrid servers to send email for the domain.
SPF for Developers
As a developer, SPF affects you when:
Setting Up Email Sending
- Add SPF records for your email service provider
- Include all services that send email (app, marketing, transactional)
- Test that emails pass SPF checks
Multiple Senders
- Combine all senders in one SPF record
- Watch the 10 DNS lookup limit
- Use includes for third-party services
SPF alone isn't enough—combine with DKIM and DMARC for full protection.
Related Terms
Related Use Cases
Try spf with plop.email
Get started with reliable email testing in minutes.