| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/email-service/reference/troubleshooting/ | [Back] [Original] |
Email authentication is critical for successful email delivery. This guide helps you troubleshoot common SPF, DKIM, and DMARC issues with Email Service.
Having multiple SPF records on your domain is not allowed and will prevent Email Service from working properly. If your domain has multiple SPF records:
Log in to the Cloudflare dashboard, select your account and domain, then go to DNS > Records.
Go to Records ↗Look for multiple TXT records starting with v=spf1.
Delete the incorrect SPF record.
Ensure you have the correct SPF records:
v=spf1 include:_spf.mx.cloudflare.net ~allcf-bounce subdomain): v=spf1 include:_spf.mx.cloudflare.net ~allIf you are unsure which SPF record is the correct one to keep, you can remove all of them and let Cloudflare regenerate the required records:
v=spf1 on the affected name.If emails are being rejected due to SPF failures:
Log in to the Cloudflare dashboard, select your account and domain, then go to DNS > Records.
Go to Records ↗Add TXT records for the appropriate service:
@ (root domain), Content: v=spf1 include:_spf.mx.cloudflare.net ~allcf-bounce, Content: v=spf1 include:_spf.mx.cloudflare.net ~allIf you already have an SPF record on the root domain, modify it to include include:_spf.mx.cloudflare.net
Common SPF record syntax issues:
v=spf1include: statements~all (SoftFail) or -all (Fail), not +allCorrect format:
v=spf1 include:_spf.mx.cloudflare.net include:other-service.com ~all
Verify your SPF record is configured correctly:
dig TXT example.com +short | grep spf
Expected result should include:
"v=spf1 include:_spf.mx.cloudflare.net ~all"
Email Service automatically generates DKIM keys for your domain, but the DNS records must be properly configured. Email Sending and Email Routing use separate DKIM selectors:
cf-bounce._domainkey).cf2024-1._domainkey).If you need to rotate DKIM keys:
Verify your DKIM records are configured correctly:
# Check Email Sending DKIM
dig TXT cf-bounce._domainkey.example.com +short
# Check Email Routing DKIM
dig TXT cf2024-1._domainkey.example.com +short
Expected result for either:
"v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
If DKIM validation is failing:
cf-bounce._domainkey.yourdomain.comcf2024-1._domainkey.yourdomain.comWhile not required, DMARC significantly improves email deliverability:
Go to DNS > Records in the Cloudflare dashboard.
Go to Records ↗Add a TXT record:
_dmarcv=DMARC1; p=quarantine; rua=mailto:dmarc@example.comIf a strict DMARC policy is causing delivery issues:
p=none (monitor only)p=quarantine then p=rejectDMARC requires either SPF or DKIM alignment:
SPF alignment: The domain in the Mail From header must align with the domain in the From header
DKIM alignment: The DKIM signature domain must align with the domain in the From header
Email Service ensures proper alignment automatically.
Verify your DMARC record:
dig TXT _dmarc.example.com +short
Example result:
"v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; sp=quarantine"
This error occurs when passing ArrayBuffer content in attachment fields during local development with wrangler dev. The local email binding simulator cannot serialize ArrayBuffer values.
Solution: Deploy your Worker with npx wrangler deploy and test binary attachments (images, PDFs) against the deployed version. String content for text-based attachments works normally in local development. Refer to local development for email sending for more details.
If emails are going to spam folders:
To reduce bounce rates:
Different ISPs have specific requirements:
Use these tools to validate your email authentication setup:
If you continue to experience authentication issues:
| Web Proxy Viewer | New URL | Original Page |