SPF, DKIM and DMARC explained
SPF, DKIM and DMARC are the three standards of email authentication. SPF lists the servers allowed to send for a domain. DKIM signs a message so changes can be detected. DMARC ties both to the address in the From line and tells receivers what to do when they fail. All three are published as DNS records.
Updated
What does each one prove?
SPF, DKIM and DMARC each answer a different question about where a message came from. None of them says whether the message is safe.
| Standard | The question it answers | What it does not prove |
|---|---|---|
| SPF (RFC 7208) | Is this server allowed to send for the domain in the envelope sender? | Anything about the From line a reader sees |
| DKIM (RFC 6376) | Did a named domain sign this message, and are the signed parts unchanged? | That the signing domain is the one in the From line |
| DMARC (RFC 9989) | Does a domain that passed SPF or DKIM match the From line, and what should happen if not? | That the sender is honest |
How does SPF work?
SPF (Sender Policy Framework) lets a domain list the servers allowed to send its mail. The receiver looks up a TXT record at the domain in the envelope sender, the MAIL FROM address, and compares the connecting server with the list.
example.com. IN TXT "v=spf1 ip4:192.0.2.0/ 24 include:_spf.example.net -all"In that record, ip4 names a range of sending servers and include pulls in a mail provider's own list. -all says every other server fails. ~all is the softer form: a softfail.
- SPF checks the envelope sender, not the From line a reader sees.
- A domain publishes one SPF record. Two records are an error.
- A record may cause at most 10 DNS lookups. Past that, the result is an error.
- Forwarding often breaks SPF, because the forwarding server is not on the original domain's list.
How does DKIM work?
DKIM (DomainKeys Identified Mail) adds a digital signature to a message. The sending system signs chosen headers and the body with a private key. The receiver fetches the matching public key from DNS and checks the signature.
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=mail2026;
h=from:to:subject:date; bh=...; b=...
mail2026._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."d= is the signing domain and s= is the selector. Together they name the DNS record that holds the key. The From header must be among the signed headers.
A valid DKIM signature proves two things: the named domain took responsibility for the message, and the signed parts were not changed after signing. A signature survives forwarding as long as the message is not altered.
DKIM does not require the signing domain to match the From line. Any domain can sign any message. DMARC closes that gap.
How does DMARC work?
DMARC (Domain-based Message Authentication, Reporting and Conformance) ties SPF and DKIM to the domain in the From line. A message passes DMARC when SPF or DKIM passes for a domain that aligns with the From domain. One aligned pass is enough.
Alignment is relaxed by default: the two domains share one organizational domain, so mail.example.com aligns with example.com. Strict alignment needs an exact match.
_dmarc.example.com. IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com"| Policy | What the domain owner is saying |
|---|---|
p=none | No preference. Used to collect reports before enforcing. |
p=quarantine | Mail that fails is suspicious. |
p=reject | Mail that fails is not a valid use of this domain. |
The rua tag asks receivers for aggregate reports, which show who is sending mail in the domain's name.
A DMARC policy is a request. RFC 9989 leaves the final decision to the receiver, and says a receiver should not reject a message solely because of a p=reject policy. It also tells domains at p=reject to sign with DKIM and not rely on SPF alone.
DMARC was revised in May 2026: RFC 9989 replaced RFC 7489. The record still starts with v=DMARC1. The pct tag is gone, replaced by a test flag, t, and a new np tag covers subdomains that do not exist.
How do the three fit together?
- The sending server connects and names the envelope sender. The receiver checks SPF.
- The message arrives. The receiver checks each DKIM signature.
- The receiver reads the From line and checks DMARC: does a domain that passed SPF or DKIM align with it?
- The receiver applies its own policy, informed by the domain's DMARC record, and writes the results into the message.
Authentication-Results: mx.example.net;
spf=pass smtp.mailfrom=example.com;
dkim=pass header.d=example.com;
dmarc=pass header.from=example.comWhat do SPF, DKIM and DMARC not prove?
Email authentication proves which domain sent a message. It does not prove the message is safe.
- A lookalike domain passes. An attacker who registers a lookalike of your domain can publish valid SPF, DKIM and DMARC records for it. See lookalike domains.
- A display name is not checked. RFC 9989 puts display name attacks out of scope: a trusted name in front of any address.
- A taken-over account passes. Mail an intruder sends from a real mailbox authenticates correctly. See account takeover.
- The content is not judged. A passing message can carry a fake invoice, a phishing link or an instruction aimed at an AI agent.
This is why authentication alone does not stop business email compromise. The FBI IC3 2025 report puts its losses at $3.05 billion.
How does Trotta Mail use them?
Trotta Mail checks SPF, DKIM and DMARC on incoming mail and records the three results in each message's verdict, under auth. Authentication is one input. The same screening looks at lookalike domains, first contact, links, files and text aimed at a model, before the message is delivered.
Using your own domain with Trotta Mail takes five DNS records, and three of them are SPF, DKIM and DMARC. The console lists the exact values and checks them. See connect a domain.
Authentication also limits a new agent. An agent that signed itself up, and that no human has claimed yet, replies only to senders whose mail arrived authenticated.
Questions
Do I need SPF, DKIM and DMARC, or is one enough?
Publish all three. SPF and DKIM each cover a gap in the other, and DMARC is what ties either one to the From line. Gmail requires SPF or DKIM from every sender, and all three from bulk senders.
Does a DMARC pass mean an email is safe?
No. A DMARC pass means a domain aligned with the From line authenticated the message. A lookalike domain or a taken-over account can pass, and the content is not judged at all.
What is DMARC alignment?
DMARC alignment means the domain that passed SPF or DKIM matches the domain in the From line. Relaxed alignment accepts the same organizational domain, and strict alignment needs an exact match.
Why does forwarded email fail SPF?
SPF compares the server that delivers the message with the original domain's list. A forwarding server is not on that list, so SPF fails unless the forwarder rewrites the envelope sender. A DKIM signature usually survives forwarding.
What is the difference between p=none, p=quarantine and p=reject?
They are the three DMARC policies. With p=none the domain owner states no preference and collects reports, with p=quarantine failing mail should be treated as suspicious, and with p=reject failing mail is not a valid use of the domain.
Sources
- RFC 7208: Sender Policy Framework (SPF), Version 1
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
- RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC), May 2026
- RFC 8601: Message Header Field for Indicating Message Authentication Status
- Google: Email sender guidelines
- FBI Internet Crime Complaint Center: 2025 Internet Crime Report