Prompt
spf dkim dmarc setup for app emails
Latest observation
Here’s a practical setup guide for SPF, DKIM, and DMARC for sending app emails (transactional or notification emails) from your domain.
1) SPF
SPF tells receivers which servers are allowed to send email for your domain.
What to add
Add a TXT record for your domain like:
v=spf1 include:YOUR-EMAIL-SERVICE -all
Common examples
If you use:
- SendGrid:
include:sendgrid.net - Mailgun:
include:mailgun.org - Postmark:
include:spf.mtasv.net - Amazon SES: usually a custom SPF setup depending on MAIL FROM domain
- Google Workspace:
include:_spf.google.com
Example
v=spf1 include:sendgrid.net -all
Notes
- Use only one SPF record per domain.
- Keep it under the 10 DNS lookup limit.
-allmeans hard fail for anything not listed.- If you’re not sure yet, you can start with
~alltemporarily, but-allis preferred for production.
2) DKIM
DKIM signs outgoing email so receivers can verify it wasn’t altered and really came from your domain.
What to add
Your email provider will give you:
- a selector
- a public key
- a TXT record like:
selector1._domainkey.yourdomain.com
Example TXT value:
v=DKIM1; k=rsa; p=PUBLIC_KEY_HERE
Notes
- Usually you add one or more CNAME/TXT records depending on your provider.
- Use 2048-bit keys if supported.
- DKIM must be enabled in your email provider dashboard too.
3) DMARC
DMARC tells receivers what to do if SPF/DKIM fail, and it gives you reporting.
What to add
Add a TXT record at:
_dmarc.yourdomain.com
Example starter policy:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; adkim=s; aspf=s
Policy options
p=none→ monitor onlyp=quarantine→ send suspicious mail to spamp=reject→ reject failed mail outright
Suggested rollout
- Start with:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com - Review reports for a week or two.
- Move to
quarantine. - Eventually move to
rejectif everything is aligned.
Alignment
DMARC passes when either SPF or DKIM passes and aligns with your domain.
Recommended setup for app emails
If your app sends mail from example.com, a solid setup is:
SPF
v=spf1 include:sendgrid.net -all
DKIM
Provider-generated record(s), e.g.
selector1._domainkey.example.com TXT "v=DKIM1; k=rsa; p=..."
DMARC
v=DMARC1; p=none; rua=mailto:dmarc@example.com
Best practices for app emails
- Use a subdomain for app mail, like
mail.example.comornotify.example.com - Send “From” addresses like:
notifications@mail.example.comno-reply@notify.example.com
- Set up SPF/DKIM/DMARC on that subdomain
- Keep transactional and marketing emails separate if possible
- Ensure your app provider uses the same domain for envelope-from and DKIM signing if possible
Important gotchas
- Don’t create multiple SPF records for the same domain.
- Don’t exceed SPF DNS lookup limits.
- DKIM alone is good, but DMARC depends on alignment.
- If using a third-party app platform, check whether they send from:
- their own domain, or
- your custom domain
- For best deliverability, authenticate the exact domain your users see in the From address.
If you want, tell me:
- your email provider (SendGrid/Mailgun/SES/Postmark/etc.)
- your domain/subdomain
- whether this is for transactional or marketing emails
…and I’ll generate the exact DNS records for you.