BlogSPF
SPF, DKIM and DMARC explained: how they work together
Anyone can type your address into the From line of an email. SPF, DKIM and DMARC are how a receiving server tells your mail from a forgery. A message can pass SPF and DKIM and still fail DMARC, and Gmail, Yahoo and Outlook now require all three from high-volume senders. Each record also has its own guide, linked at the end.
Short answer
SPF, DKIM and DMARC are three DNS records that prove an email comes from your domain. SPF lists the servers allowed to send for it, DKIM signs each message with a key published in your DNS, and DMARC checks that one of them passed for the domain in the From address. DMARC also tells receivers what to do when neither did: deliver, send to spam, or reject. Set them up in that order.
How SPF, DKIM and DMARC work together
SPF checks the sending server, DKIM checks a signature, and DMARC checks that one of them belongs to the domain in the From address. Together they let a receiving server tell your mail from a forgery, because anyone can type your address into the From line. Each answers one question.Sources[1]RFC 7208: Sender Policy Framework (SPF)[2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
- SPF answers: was this message sent from a server the domain allows? It checks the envelope sender, the hidden address that bounces go to.
- DKIM answers: was this message signed by the domain, and has it changed since? The signature names its domain in the
d=tag. - DMARC answers: do either of those results belong to the domain in the From address the reader sees? If not, it tells the receiver what to do.
SPF and DKIM each prove something about some domain. Neither, on its own, says that domain is the one in the From line. DMARC closes that gap, which is why it depends on the other two.[3]
SPF vs DKIM vs DMARC
| At a glance | SPF | DKIM | DMARC |
|---|---|---|---|
| What it checksSources[1]RFC 7208: Sender Policy Framework (SPF)[2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC) | The sending server's IP address is listed for the envelope sender's domain | The message carries a valid signature from the signing domain (d=) | SPF or DKIM passed for a domain that matches the From address |
| Where the record livesSources[1]RFC 7208: Sender Policy Framework (SPF)[2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC) | TXT record on the domain itself, such as example.com | TXT record at selector._domainkey.example.com | TXT record at _dmarc.example.com |
| ExampleSources[6]Google Workspace Admin Help: set up SPF[2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC) | v=spf1 include:_spf.google.com ~all | v=DKIM1; k=rsa; p= followed by the public key | v=DMARC1; p=none; rua=mailto:dmarc@example.com |
| What failure meansSources[1]RFC 7208: Sender Policy Framework (SPF)[2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC) | The server is not on the list, or the record is broken | The message changed after signing, or the key is missing or wrong | Receivers apply your policy: none, quarantine or reject |
| After forwardingSources[1]RFC 7208: Sender Policy Framework (SPF)[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC) | Usually fails | Usually still passes | Passes if DKIM still passes and aligns |
SPF: which servers may send
SPF is one TXT record on your domain that starts with v=spf1 and lists allowed servers, usually through include values from your providers. A domain can have only one SPF record, and checking it may take at most 10 DNS lookups. SPF breaks when mail is forwarded, because the forwarding server's IP address is not on your list.[1]
DKIM: a signature on every message
With DKIM, your email provider signs each outgoing message and adds a DKIM-Signature header. That header names the signing domain (d=) and a selector (s=). The receiver fetches the public key from a TXT record at selector._domainkey on that domain and checks the signature. A domain can have several selectors, one per service, so adding a new sender never means replacing a key.[2]
You do not write the DKIM key yourself. Each provider that sends for you generates its own key and gives you the record to publish.[2]
DMARC: the policy that ties them to your From address
DMARC is a TXT record at _dmarc on your domain. A message passes DMARC when SPF or DKIM passes for a domain aligned with the From address. Only one of the two needs to pass. The p tag sets what happens to mail that fails: none (deliver as normal and report), quarantine (treat as suspicious, usually the spam folder) or reject (refuse it). The rua tag gives an address where receivers send aggregate reports.[3]
DMARC is now defined by RFC 9989, published in May 2026, which replaces RFC 7489. Existing v=DMARC1 records keep working. The new version drops the pct, rf and ri tags and adds np, psd and t.Sources[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)[4]RFC 7489: Domain-based Message Authentication, Reporting and Conformance (DMARC)
Alignment, with a worked example
Alignment means the domain SPF or DKIM checked matches the domain in the From address. For SPF, the compared domain is the envelope sender's. For DKIM, it is the d= domain in the signature. By default alignment is relaxed: news.example.com aligns with example.com because they share the same organizational domain. Strict alignment, set with aspf=s or adkim=s, needs the exact same domain.[3]
Say you send a newsletter From: hello@example.com through a mailing service. The service uses its own envelope sender, bounces@mailer.example.net, and signs with d=mailer.example.net. SPF passes for mailer.example.net. DKIM passes for mailer.example.net. Neither is example.com, so DMARC fails, and with p=reject your newsletter is refused.[3]
There are two fixes, and you can use both. Set up a custom return path, such as bounce.example.com, which the service asks you to point at it, so SPF aligns. Or turn on DKIM signing with your own domain, so the signature says d=example.com. DKIM alignment is the one to get right first, because it still works after forwarding.[3]
The order to set them up
Set up SPF first, then DKIM, then DMARC, after you list every service that sends as your domain. Start DMARC at p=none if several services send for you, and move to p=quarantine and p=reject once the reports are clean.Sources[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)[7]Microsoft Learn: set up SPF for your Microsoft 365 domain
- Step 1
List everything that sends as your domain
Your mailbox provider, plus newsletter tools, invoicing, a CRM, a help desk, and your website's contact form.
- Step 2
Publish one SPF record
Add an
includefor each of those services in a single record, ending in~allwhile you check. - Step 3
Turn on DKIM in each service
Publish the DKIM record each one gives you, and check that it signs with your domain, not its own.
- Step 4
Add DMARC at p=none if several services send for you
Start with
v=DMARC1; p=none; rua=mailto:dmarc@example.com. Nothing is blocked yet, and the reports show which senders fail. If your mailbox provider is the only thing that sends as your domain, you can publishp=rejectfrom day one. - Step 5
Fix failures, then enforce
When the reports show only your own services passing, change
p=nonetop=quarantine, and later top=reject.
Gmail and Yahoo sender requirements
Since February 2024, Gmail and Yahoo require email authentication from everyone who sends to them. The rules have two levels.Sources[8]Gmail email sender guidelines[9]Yahoo Sender Hub best practices
- All senders: SPF or DKIM for your sending domain, and a spam rate below 0.3%. Gmail also asks for TLS, valid forward and reverse DNS for sending servers, and correctly formatted messages.
- Bulk senders: SPF and DKIM both, a DMARC record that passes (
p=noneis enough), and a From domain aligned with SPF or DKIM. Marketing and subscribed mail needs one-click unsubscribe. - Gmail counts you as a bulk sender above 5,000 messages a day to personal Gmail accounts, and recommends keeping the spam rate below 0.1%.
- Yahoo gives no numeric threshold for bulk senders, accepts relaxed alignment, and asks you to honor unsubscribes within 2 days.
Microsoft added the same SPF, DKIM and DMARC requirement for domains sending more than 5,000 emails a day to Outlook.com, starting in May 2025.[10]
SPF, DKIM and DMARC checklist
A domain is set up when it has one SPF record within 10 DNS lookups, DKIM signing in every sending service, and a DMARC record with a rua address. A received message should show spf=pass, dkim=pass and dmarc=pass.Sources[1]RFC 7208: Sender Policy Framework (SPF)[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)[5]RFC 8601: Authentication-Results header field
- One SPF record on the domain, starting with
v=spf1and listing every sending service. - The SPF record needs 10 DNS lookups or fewer.
- DKIM turned on in every service that sends as you, signing with your domain.
- A DMARC record at
_dmarcwith aruaaddress, so you get reports. - In a received message, the
Authentication-Resultsheader showsspf=pass,dkim=passanddmarc=pass. - DMARC moved from
p=noneto quarantine or reject once the reports are clean. - Domains that send no mail have
v=spf1 -alland a DMARC record atp=reject.
Shipmail's free SPF, DKIM and DMARC checkers look up each record for your domain, and the DMARC generator writes a new record from the policy you choose.
SPF, DKIM and DMARC on Shipmail
When you add a domain, Shipmail gives you the MX, SPF, DKIM and DMARC records, can publish them for you, and rechecks them until they verify. The DMARC record is set to p=reject, which is safe when Shipmail is your only sender. If other services still send as your domain, switch to a custom DMARC policy while you fix them.Sources[11]Shipmail domain setup documentation[12]Shipmail DNS setup docs: DMARC record
Newsletters and transactional email avoid the alignment trap in the example above. Each sends from its own subdomain of your domain, such as news.example.com or notify.example.com, with its own DKIM and return-path records, so both align with your From domain under relaxed alignment.Sources[13]Shipmail newsletter editor documentation[14]Shipmail transactional email documentation[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
Sources14 sourcesVerified 2026-11-09
- [1]RFC 7208: Sender Policy Framework (SPF)
Sections 1.1.3 and 2.4: SPF checks the MAIL FROM identity from the SMTP envelope, and can also check HELO. Section 2.6: results are none, neutral, pass, fail, softfail, temperror and permerror. Section 3.2: a domain must not publish more than one SPF record; Section 4.5: two records give permerror. Section 4.6.2: the qualifiers + (pass, the default), - (fail), ~ (softfail) and ? (neutral). Section 4.6.4: include, a, mx, ptr, exists and redirect count toward a limit of 10 DNS lookups, all, ip4 and ip6 do not, and void lookups should be limited to two; going over gives permerror. Section 5.5: ptr should not be published. Section 6.1: redirect is ignored when the record has an all mechanism. Section 10.3 and Appendix D: a forwarder resends from its own IP address, so SPF fails unless the forwarder rewrites MAIL FROM.
rfc-editor.org · 2026-10-11
- [2]RFC 6376: DomainKeys Identified Mail (DKIM) signatures
Section 3.5: the signature is stored in the DKIM-Signature header field; d= is the signing domain, s= the selector, bh= the body hash and b= the signature data. Section 3.6.2.1: the public key is a DNS TXT record at selector._domainkey.domain. Section 3.5: h= lists the header fields that were signed; Section 5.4: the From header field MUST be signed. Section 3.6.1: key record tags v=DKIM1, k (default rsa) and p, where an empty p= means the key was revoked. Section 3.1: selectors allow several keys per domain and routine key replacement. Section 3.11: DKIM itself does not require d= to match any other header. Relays that do not change the content preserve the signature.
rfc-editor.org · 2026-10-11
- [3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
Published May 2026 on the Standards Track; obsoletes RFC 7489 and RFC 9091. Section 4.7 tags: v=DMARC1 (required, first), p (none, quarantine, reject; treated as none if absent), sp (existing subdomains, defaults to p), np (non-existent subdomains), psd, t (test mode y or n, default n), rua and ruf (mailto: report addresses), adkim and aspf (r relaxed or s strict, default r), fo (default 0, ignored without ruf: 0 asks for a failure report when all mechanisms fail to give an aligned pass, 1 when any fails, d when a DKIM signature failed, s when SPF failed). Section 4.1: the policy record is a TXT record at _dmarc.<domain>. With t=y the domain owner is testing and expects failing mail to get the policy one step lower, so quarantine becomes none and reject becomes quarantine; t has no effect on reports. Relaxed alignment means the same organizational domain, strict means identical domains. If several DMARC records are returned for one name, all are discarded. Appendix A.6 removes pct, replaced by t, whose y and n values match pct=0 and pct=100; Appendix C.5.2 lists rf and ri as removed. Section 7.4: in forwarding, SPF will most likely fail while DKIM signatures generally remain valid; a domain publishing p=reject MUST NOT rely only on SPF and MUST apply valid DKIM signatures; domains whose users post to mailing lists should not publish p=reject, or should first publish p=none for at least a month and then p=quarantine for as long.
rfc-editor.org · 2026-10-11
- [4]RFC 7489: Domain-based Message Authentication, Reporting and Conformance (DMARC)
Section 6.1: the DMARC record is a TXT record at _dmarc.domain. Section 6.3: p=none requests no specific action, p=quarantine asks receivers to treat failing mail as suspicious, such as filing it in spam, p=reject asks them to refuse it; pct sets the percentage of mail the policy applies to, default 100. Sections 3.1 and 4.2: a message passes DMARC when SPF or DKIM passes for a domain aligned with the From domain.
rfc-editor.org · 2026-10-11
- [5]RFC 8601: Authentication-Results header field
Authentication-Results records the results of message authentication checks such as SPF and DKIM so mail clients and filters can use them. The receiving server that performed the checks adds it at the top of the message; the first element is the authserv-id naming that service. Before adding its own, a server should remove instances claiming to come from its own trust boundary. Results include pass, fail, softfail (SPF), neutral, none, temperror and permerror.
rfc-editor.org · 2026-10-11
- [6]Google Workspace Admin Help: set up SPF
For a domain that sends only through Google Workspace, the SPF record is v=spf1 include:_spf.google.com ~all. Each domain must have its own SPF record, and Google recommends ~all.
knowledge.workspace.google.com · 2026-10-11
- [7]Microsoft Learn: set up SPF for your Microsoft 365 domain
SPF checks the MAIL FROM (envelope sender) address. For Microsoft 365 the record is v=spf1 include:spf.protection.outlook.com -all, and a parked domain that sends no mail publishes v=spf1 -all. Only one SPF record is allowed per domain or subdomain, and each subdomain needs its own. Microsoft recommends -all with DKIM and DMARC. More than 10 DNS lookups gives permerror; include, a, mx, exists and redirect each count, ip4, ip6 and all do not. To reduce lookups: replace includes with IP addresses for vendors with stable ranges (flattening), move services to subdomains, or consolidate services. Microsoft 365 itself should not be flattened because its IP addresses change.
learn.microsoft.com · 2026-10-11
- [8]Gmail email sender guidelines
Since February 1, 2024, all senders to Gmail need SPF or DKIM, valid forward and reverse DNS, TLS, RFC 5322 formatting, and a Postmaster Tools spam rate below 0.3% (best practice below 0.1%). Senders of more than 5,000 messages a day also need SPF, DKIM and DMARC (policy may be none), a From domain aligned with SPF or DKIM, and one-click unsubscribe for marketing and subscribed mail. Messages of the same category should have the same From address, display names should be a consistent and accurate statement of the sender's identity, and subject lines should not start with Re: or Fwd: unless the message is a real reply or forward. The page does not mention no-reply addresses.
support.google.com · 2026-10-11
- [9]Yahoo Sender Hub best practices
Yahoo asks bulk senders to implement SPF and DKIM, publish a DMARC policy of at least p=none that passes, support one-click unsubscribe for marketing and subscribed mail, honor unsubscribes within 2 days, and keep the spam rate below 0.3%.
senders.yahooinc.com · 2026-10-11
- [10]Microsoft: Outlook's requirements for high-volume senders
Microsoft's April 2025 announcement that Outlook.com requires SPF, DKIM and DMARC (at least p=none, aligned with SPF or DKIM) from domains sending more than 5,000 emails a day, starting May 2025.
techcommunity.microsoft.com · 2026-10-11
- [11]Shipmail domain setup documentation
Adding a domain to Shipmail: four DNS records (MX, SPF, DKIM and DMARC), published automatically or by hand, suggested merging of an existing SPF record, and verification that rechecks the records every 30 seconds.
shipmail.to · 2026-10-11
- [12]Shipmail DNS setup docs: DMARC record
Shipmail's DNS setup steps for each registrar end with a TXT record named _dmarc with the value v=DMARC1; p=reject. The GoDaddy steps start from My Products, then DNS, and note that most records appear within 30 minutes.
shipmail.to · 2026-10-15
- [13]Shipmail newsletter editor documentation
Newsletters written in Shipmail with a rich text editor, design blocks, custom HTML or plain text, preview, test sends and pre-send review checks.
shipmail.to · 2026-10-15
- [14]Shipmail transactional email documentation
Shipmail transactional email: an app sends from its own sending subdomain of a domain already verified in Shipmail, and replies go to a Shipmail mailbox. Sends count toward the plan's monthly quota, a sender costs nothing extra, Activity shows delivery status, and a retry with the same Idempotency-Key returns the first message. Every email from a sender carries its mailbox's address as Reply-To, so replies arrive in that mailbox's Transactional folder; the sending address itself cannot receive email. On a paid plan, an organization's transactional email starts at a safety limit of 1,000 recipients a day, raised daily to twice the highest clean day of the last 7 days, up to 25,000 automatically; the plan keeps 80% of its daily limit as a floor; a migration review with the last 30 days gets an answer within one business day.
shipmail.to · 2026-11-09
Questions worth answering
Common questions about spf dkim dmarc.
What is the difference between SPF, DKIM and DMARC?
Do I need all three?
Can an email pass SPF and DKIM but fail DMARC?
Which should I set up first?
p=none if several services send as your domain, and move to quarantine or reject once the reports show them all passing.Sources[3]RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)[7]Microsoft Learn: set up SPF for your Microsoft 365 domainDoes DMARC need both SPF and DKIM to pass?
Related guides
More on Shipmail pricing, comparisons, and team workflows.
Email, newsletters and booking pages on your own domain, in one plan.
Get started for free