Skip to content

SPF, DKIM and DMARC explained

By the Mail Crafting team · Updated · 5 min read

The short answer

SPF lists the servers allowed to send email for your domain. DKIM adds a signature that proves a message was not changed on the way. DMARC tells receiving servers what to do when those checks fail. You need all three to send bulk email to Gmail and Yahoo.

If you've ever had a campaign land in spam for no obvious reason, your domain's DNS records are the first place to look. These three records let a receiving mail server check that an email claiming to be from you really is. Since 2024, Gmail and Yahoo have required all three from anyone sending in bulk.

What does SPF do?

SPF (Sender Policy Framework) is a list of the servers allowed to send email for your domain. You publish it as a single TXT record on the domain itself. A typical record looks like this:

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

When a message arrives, the receiving server compares the sending server against this list. Two mistakes come up all the time. The first is having two SPF records, because a domain may only have one, so you need to merge them. The second is having too many include entries: SPF allows 10 DNS lookups, and going over that makes the check fail.

What does DKIM do?

DKIM (DomainKeys Identified Mail) signs each email with a private key held by your provider. The matching public key sits in your DNS, at an address like selector._domainkey.yourdomain.com. The receiving server uses it to confirm the message wasn't changed in transit and that your domain approved it.

Your provider gives you the record to add. The "selector" is just the name of the key, and your provider will tell you what it is.

What does DMARC do?

DMARC ties the other two together. It tells receiving servers what to do if a message fails, and where to send reports about it. You publish it as a TXT record at _dmarc.yourdomain.com. Start with a policy that only monitors:

v=DMARC1; p=none; rua=mailto:reports@yourdomain.com

Once the reports show your real email passing, you can move to p=quarantine, and later p=reject. Don't jump straight to reject, or you may block your own invoices and password resets from a system you forgot about.

How do I set them up?

  1. Sign in to wherever your domain's DNS is managed.
  2. Find the SPF and DKIM values in your email provider's domain settings, and add them.
  3. Add a DMARC record with p=none.
  4. Wait for DNS to update, which is often minutes but can take up to a day or two.
  5. Send a test to a Gmail address, open it, and choose "Show original". You want to see SPF, DKIM and DMARC all marked as PASS.

In Mail Crafting, the Sender Identities screen looks these records up for you, so you can see what's missing without leaving the app.

Sources

Make every email count

Bring your list and your SMTP account. Your first campaign can be ready the same day.