Guide · Set-up

SPF, DKIM and DMARC for cold email

Short answer

SPF lists the servers allowed to send for a domain. DKIM adds a signature that proves a message came from the domain and was not changed. DMARC checks that the visible From domain matches a passing SPF or DKIM domain and tells receivers what to do if not. Every cold email sending domain needs all three.

Written by Outboxes, which sells private SMTP mailboxes for cold email: one of the options this guide describes.

What does SPF do?

SPF (Sender Policy Framework, RFC 7208) is a TXT record on the domain that lists which servers may send mail using that domain in the envelope sender (the return-path address). The receiving server compares the connecting IP with the list and gets a result such as pass, fail or softfail.

example-mail.com.  TXT  "v=spf1 include:_spf.provider.example ~all"

include: pulls in your mail provider's list. ~all marks everything else as softfail; -all marks it as fail. A domain has exactly one SPF record; two records make SPF fail.

What is the 10-lookup SPF limit?

RFC 7208 section 4.6.4 limits SPF evaluation to 10 DNS lookups. Each include, a, mx, ptr and exists mechanism and each redirect counts, including lookups inside included records. Past 10, the result is a permanent error, and receivers treat SPF as broken. Sending domains used only for cold email rarely need more than one or two includes, which is one reason to keep them separate from the main company domain.

What does DKIM do?

DKIM (DomainKeys Identified Mail, RFC 6376) signs each outgoing message with a private key held by the mail server. The public key is published in DNS under a selector, and the receiver uses it to check the signature. A valid signature shows that the signing domain took responsibility for the message and that the signed parts were not changed in transit.

s1._domainkey.example-mail.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkq...IDAQAB"

s1 is the selector; the provider tells you which selector and key to publish.

What does DMARC do, and what is alignment?

DMARC (RFC 7489) ties SPF and DKIM to the From address the recipient sees. A message passes DMARC when SPF or DKIM passes and the domain that passed is aligned with the From domain. In relaxed alignment, the default, the domains must share the same organisational domain (mail.example-mail.com aligns with example-mail.com); in strict alignment they must match exactly.

_dmarc.example-mail.com.  TXT  "v=DMARC1; p=none; rua=mailto:[email protected]"

p is the policy. rua is where receivers send aggregate reports, usually daily,, which show who sends mail as your domain and whether it passes.

How should the DMARC policy move from none to reject?

PolicyWhat receivers are asked to doWhen to use it
p=noneDeliver as normal; send reports onlyA new domain, while you confirm in reports that all your mail passes
p=quarantineTreat failing mail as suspicious, usually the spam folderOnce reports show your legitimate mail passing
p=rejectRefuse failing mailWhen you are sure every legitimate source passes

Google's sender guidelines accept p=none as the minimum for bulk senders. Our recommendation for a sending domain that only one provider sends from: start at p=none, read the reports for a few weeks, then move to quarantine.

Do subdomains need their own records?

For SPF and DKIM, yes: an SPF record applies only to the exact name it is published on, and each signing name needs its DKIM key under its own selector. DMARC is different. If a subdomain has no DMARC record of its own, receivers apply the organisational domain's record, using its sp tag if present, otherwise its p tag. Sending from the bare secondary domain keeps this simple.

How do you verify that all three pass?

  1. Look up the records. Query the TXT records of the domain, of selector._domainkey.domain and of _dmarc.domain, for example with dig TXT _dmarc.example-mail.com. Check that there is exactly one SPF record and one DMARC record.
  2. Send a test message to a Gmail address you control, open it and choose Show original. Gmail lists SPF, DKIM and DMARC with PASS or FAIL for that message.
  3. Read the DMARC reports once they arrive, to catch sources you forgot.

Outboxes sets SPF, DKIM, DMARC and a tracking domain on every domain it hosts and tests them before hand-over.

What does passing authentication not tell you?

Passing SPF, DKIM and DMARC proves who sent a message. It says nothing about whether recipients want it. Authentication is required for good placement, not sufficient for it: see why cold emails go to spam.

Sources

  1. RFC 7208: Sender Policy Framework (SPF)
  2. RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
  3. RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
  4. Google: Email sender guidelines
  5. Google Workspace: Set up DMARC

Questions

Do I need SPF, DKIM and DMARC for cold email?

Yes. Google and Yahoo require SPF or DKIM from every sender and all three from bulk senders, and missing records are one of the most common causes of spam placement.

What DMARC policy should a new sending domain use?

Start with p=none and a reporting address, confirm in the reports that your mail passes, then move to quarantine and, if you choose, reject.

Can a domain have two SPF records?

No. Two SPF records make SPF evaluation fail. Merge them into one record.

What happens if SPF needs more than 10 DNS lookups?

SPF returns a permanent error, which receivers treat as a failure. Remove includes you no longer use.

Related guides and tools

From €0.67 per inbox · 25 inboxes minimum

See pricing