SPF, DKIM and DMARC Explained: How to Stop Your Emails Going to Spam

Written by

in

If emails from your domain end up in spam or are rejected, the cause is usually missing authentication records. Three DNS records fix most of it: SPF, DKIM and DMARC.

SPF: who may send email for your domain

SPF is a TXT record that lists the servers allowed to send mail for your domain. A simple example:

v=spf1 include:_spf.yourprovider.com ~all

Use only one SPF record per domain, and include every service that sends email for you, such as your mail host, newsletter tool or invoicing system.

DKIM: a signature that proves the message is genuine

DKIM adds a digital signature to each email. Your mail provider gives you a public key, which you publish as a TXT record under a selector name, for example selector1._domainkey. Receiving servers use it to check that the message was not changed.

DMARC: what to do when a check fails

DMARC tells receiving servers how to treat messages that fail SPF or DKIM, and where to send reports. Start gently:

v=DMARC1; p=none; rua=mailto:[email protected]

After checking the reports for a few weeks, move to p=quarantine and later p=reject.

Setup checklist

  1. Find out every service that sends email as your domain.
  2. Publish one SPF record that includes all of them.
  3. Enable DKIM in your mail provider and add the TXT record.
  4. Add a DMARC record with p=none and a reporting address.
  5. Send a test message to a mailbox you control and check the headers for spf=pass, dkim=pass and dmarc=pass.

Common mistakes

  • Two SPF records on one domain, which makes SPF fail.
  • More than 10 DNS lookups in SPF.
  • Forgetting a service that sends email, such as a contact form plugin.
  • Turning DMARC to reject before reading the reports.

Our hosting package includes email on your domain with SPF and DKIM set up for you.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready to talk about your website?Get a free quote