SPF, DKIM & DMARC Setup: Email Authentication and Deliverability Guide

Author Avatar Digital Bhatti
• September 25, 2026 • Web Hosting

SPF, DKIM, and DMARC are domain-based email authentication technologies used to help receiving mail systems verify whether messages claiming to come from your domain are authorized and whether the visible sender identity aligns with authenticated domains.

They are important for reducing domain spoofing and improving the trustworthiness of legitimate email, but they are not a guarantee that every authenticated message will reach the inbox. Delivery can also depend on sender reputation, complaint rates, DNS configuration, message formatting, content, sending patterns, TLS, IP reputation, and recipient behavior.

This guide explains how SPF, DKIM, and DMARC work together, how to publish the required DNS records, how alignment works, how to introduce DMARC safely, and how to troubleshoot authentication failures without making risky changes to a production mail domain.

Research methodology

This guide uses SPF RFC 7208, the current Standards Track DMARC specifications RFC 9989 and RFC 9990, current Gmail sender requirements, current Yahoo sender requirements and provider documentation. Examples are illustrative; always use the records generated or required by the actual sending service, then verify the final DNS names and real message headers.

Last verified: September 25, 2026. Mailbox-provider requirements, authentication standards and sending-platform DNS records can change; verify the current provider documentation before enforcing production policy.

Current standards and provider snapshot — September 25, 2026

DMARC: RFC 9989 and RFC 9990 were published in May 2026 as Standards Track specifications and replace the old RFC 7489-era baseline.

Gmail: all senders to personal Gmail accounts need SPF or DKIM; bulk senders around 5,000+ messages/day need SPF, DKIM and DMARC, plus the other current sender requirements. Google's FAQ says bulk-sender status does not expire after classification.

Yahoo: all senders need SPF or DKIM; bulk senders need both SPF and DKIM plus a valid DMARC policy with at least p=none. Yahoo does not publish a fixed public message-count threshold for bulk status.


Email Authentication Rule

Authenticate Every Legitimate Sender Before Enforcing DMARC

Inventory every legitimate sending platform first. SPF, DKIM and DMARC enforcement should follow the real sender inventory—not precede it. Moving directly to p=reject can break valid third-party mail when authentication or alignment is incomplete.


1. SPF vs DKIM vs DMARC at a Glance

Technology Primary Role Published In
SPF Authorizes sending infrastructure for the envelope domain DNS TXT
DKIM Cryptographically signs selected message content and headers Public key in DNS TXT
DMARC Checks domain alignment and publishes policy/reporting instructions DNS TXT at _dmarc

2. How SPF, DKIM and DMARC Work Together

SPF → authenticates the envelope domain / sending infrastructure
DKIM → authenticates a cryptographic signature and signing domain
DMARC → checks whether SPF or DKIM passes AND aligns with the visible From domain

A message does not need both SPF and DKIM to align in order to pass DMARC. DMARC passes when at least one authenticated mechanism aligns with the visible From domain. However, current Gmail bulk-sender requirements require bulk senders to set up both SPF and DKIM, and Gmail recommends aligning both where possible.


3. Email Has More Than One Sender Identity

A message can contain several domain identities.

Important examples include:

  • The visible From: address.
  • The SMTP envelope sender or Return-Path domain.
  • The DKIM signing domain.

Understanding these identities is essential because DMARC evaluates whether the visible From domain aligns with an authenticated SPF or DKIM domain.


4. What SPF Does

Sender Policy Framework (SPF) allows a domain owner to publish which mail systems are authorized to send mail using that domain in the SMTP envelope identity.

A simple example can look like:

v=spf1 include:_spf.example-provider.com -all

This is only an illustration. Use the record supplied by your actual email provider.


5. SPF Is Checked Against the Envelope Domain

A common misunderstanding is that SPF simply checks the visible address users see in their inbox.

SPF normally authenticates the SMTP envelope identity.

DMARC is what connects SPF authentication to the visible From domain through alignment.


6. Publish Only One SPF Record Per Domain

Do not create multiple independent SPF TXT records such as:

v=spf1 include:provider-a.example -all

v=spf1 include:provider-b.example -all

If both providers legitimately send mail, their authorization normally needs to be represented within one valid SPF policy.


7. Example Combined SPF Structure

A conceptual combined record may look like:

v=spf1
include:provider-a.example
include:provider-b.example
-all

The actual syntax should remain on one valid TXT-record value according to your provider instructions.


8. SPF Has a 10-DNS-Querying-Term Limit

SPF is not unlimited. RFC 7208 requires SPF implementations to limit the number of DNS-querying terms used during evaluation to 10.

The terms that count toward this limit include mechanisms/modifiers such as:

  • include
  • a
  • mx
  • ptr
  • exists
  • redirect

If evaluation exceeds the limit, SPF returns a permerror. Nested include: records can consume additional lookups, so a short-looking SPF record can still exceed the limit indirectly.

The ptr mechanism also counts toward DNS-processing limits, but RFC 7208 explicitly says it SHOULD NOT be published. Prefer more reliable mechanisms supplied by the actual sending provider.

Do not keep adding SaaS providers without checking the complete evaluation chain.


9. SPF Flattening Is Not a Universal Fix

Some administrators reduce SPF lookup depth by replacing provider mechanisms with resolved IP addresses. This can lower lookup count, but it also creates maintenance risk when a provider changes its sending infrastructure.

Do not flatten SPF manually unless you have a process to keep the result synchronized with the sender's current published ranges. Reducing lookup count is useful only if authorization remains accurate.

Verify the published SPF record directly

dig +short TXT example.com

# Follow a provider include separately:
dig +short TXT _spf.example-provider.com

Inspect the complete include/redirect chain rather than counting only the mechanisms visible in the first TXT response.


10. SPF Forwarding Limitations

Normal message forwarding can cause SPF to fail because the forwarding server may not be authorized by the original envelope domain.

This is one reason DKIM is important: a valid DKIM signature can survive forwarding when the signed message content is not changed in a way that invalidates the signature.


11. What DKIM Does

DomainKeys Identified Mail (DKIM) adds a cryptographic signature to outgoing mail.

The sending server signs selected message data with a private key.

The receiving server retrieves the corresponding public key from DNS and verifies the signature.


12. DKIM Architecture

Outgoing Mail Server
        ↓
Signs message with private key
        ↓
Recipient Server
        ↓
Looks up public DKIM key in DNS
        ↓
Verifies signature

13. DKIM Selectors

DKIM uses a selector to identify which public key should be retrieved.

A DNS hostname may look like:

selector1._domainkey.example.com

The selector makes key rotation and multiple sending systems possible.


14. DKIM Public Key Record

A simplified structure may look like:

v=DKIM1; k=rsa; p=<public-key-material>

Copy the exact value provided or generated by the sending platform.


15. Keep the DKIM Private Key Private

The public key belongs in DNS.

The private key belongs only on authorized sending infrastructure.

Do not publish the private DKIM key in:

  • DNS.
  • GitHub.
  • Documentation screenshots.
  • Public support forums.

16. DKIM Key Length

Current Gmail sender guidance requires DKIM keys of at least 1024 bits for mail sent to personal Gmail accounts and recommends 2048 bits when the provider supports it. For other mailbox providers, follow their current sender documentation and your sending platform’s supported key sizes.

Use the strongest key length supported by both your sending provider and DNS platform, and follow the provider's generated selector/record exactly.


17. Rotate DKIM Keys

Selectors allow a safer rotation strategy.

A typical sequence is:

  1. Create a new selector and key pair.
  2. Publish the new public key.
  3. Start signing with the new selector.
  4. Confirm successful authentication.
  5. Retire the old key after an appropriate transition period.

18. What DMARC Does

The current standards-track DMARC specification is RFC 9989, with aggregate reporting defined in RFC 9990.

Domain-based Message Authentication, Reporting and Conformance (DMARC) builds on SPF and DKIM.

It asks two important questions:

  1. Did SPF or DKIM authenticate?
  2. Does at least one authenticated domain align with the visible From domain?

It can also publish a requested handling policy and reporting addresses.

What changed in the 2026 DMARC Standards Track update?

RFC 9989 and RFC 9990 were published in May 2026 and supersede the older RFC 7489 baseline.

  • pct= is historic: do not copy old percentage-rollout recipes that rely on pct.
  • t= is the current test-mode signal: t=y is not percentage sampling.
  • np= can express policy for non-existent subdomains.
  • sp= continues to express policy for existing subdomains of the organizational domain.
  • rua and ruf remain active reporting tags, while aggregate reporting is defined separately in RFC 9990.

Mailbox-provider requirements can narrow or add to the base protocol, so standards compliance and Gmail/Yahoo delivery requirements should be checked separately.


19. DMARC Record Location

DMARC is published under:

_dmarc.example.com

20. Start with a Monitoring Policy

A basic monitoring-stage record can look conceptually like:

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

Use a mailbox or reporting service capable of handling DMARC aggregate reports.


21. What p=none Means

p=none is commonly used for monitoring.

It lets domain owners collect authentication information without requesting quarantine or rejection solely from the DMARC policy.

It is not the same as having no DMARC record.

Aggregate reporting with rua

The rua= tag specifies where DMARC aggregate XML reports should be sent. Aggregate reports are useful for identifying sending sources, SPF/DKIM results and alignment patterns before stricter enforcement.

Forensic/failure reporting with ruf

The ruf= tag can request message-specific DMARC failure reports, but not every receiver sends them. They can expose message-related metadata or content depending on implementation, so use them only when you understand receiver support, privacy, retention and access controls.


22. DMARC Quarantine

A stricter policy can request quarantine handling for messages that fail DMARC:

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

Do not move to quarantine before authenticating legitimate senders.


23. DMARC Reject

A stronger enforcement policy can request rejection:

v=DMARC1; p=reject; rua=mailto:[email protected]
DMARC Safety Do not copy a strict p=reject record into a production domain until you have identified and correctly authenticated all legitimate senders. A strict policy can cause valid third-party mail to fail if alignment is broken.

24. DMARC Alignment

Authentication alone is not enough for DMARC.

The authenticated domain must align with the visible From domain.

For example:

Visible From:
[email protected]

DKIM signing domain:
example.com

Result:
Potential DKIM alignment

25. SPF Alignment

SPF can contribute to DMARC when the authenticated envelope domain aligns with the From domain.

A message can therefore:

  • Pass SPF but fail DMARC because of misalignment.
  • Fail SPF but still pass DMARC through aligned DKIM.

26. DKIM Alignment

DKIM can contribute to DMARC when the signing domain aligns with the visible From domain.

This often makes properly configured DKIM especially valuable in environments where mail is forwarded.


27. Relaxed vs Strict Alignment

DMARC supports relaxed and strict domain alignment modes.

Relaxed alignment can permit organizational-domain relationships between subdomains and the parent domain.

Strict alignment requires a closer domain match.

Do not enable strict modes without understanding every sender and subdomain involved.


28. Third-Party Email Platforms

A domain may legitimately send mail through:

  • Google Workspace.
  • Microsoft 365.
  • Helpdesk software.
  • CRM systems.
  • Newsletter platforms.
  • Transactional email services.
  • WordPress SMTP providers.

Each sender needs the appropriate authentication configuration.


29. Create a Sender Inventory

Before changing DMARC enforcement, document:

Sender Purpose SPF DKIM
Business mailbox Human email Verify Verify
WordPress SMTP Transactional Verify Verify
Newsletter platform Marketing Verify Verify

30. WordPress Email

WordPress websites can send:

  • Password-reset messages.
  • Contact-form notifications.
  • WooCommerce orders.
  • Membership notifications.

Do not assume the web server's default PHP mail transport is the best production mail architecture.


31. Use an Authenticated Mail Provider for Important Transactional Mail

For critical application mail, a dedicated SMTP or transactional-email provider can offer:

  • Authenticated sending.
  • DKIM support.
  • Bounce handling.
  • Delivery logs.

This does not eliminate the need to configure your domain's DNS correctly.


32. Sending from a VPS Requires More Than SPF

If you operate your own mail server, you may also need:

  • Forward DNS.
  • Reverse DNS / PTR.
  • TLS.
  • Correct HELO/EHLO identity.
  • IP reputation.
  • Queue management.
  • Bounce processing.

Self-hosting a web server does not mean you should automatically self-host outbound email.


33. PTR / Reverse DNS

Mailbox providers can evaluate whether a sending IP has valid reverse DNS and whether the corresponding hostname resolves back appropriately.

PTR records are normally configured by the IP or hosting provider, not through an ordinary website DNS TXT record.


34. SPF, DKIM and DMARC Do Not Replace PTR

Email infrastructure is layered.

You may need:

Forward DNS
+
Reverse DNS
+
TLS
+
SPF
+
DKIM
+
DMARC
+
Good Sending Practices

35. DNS TTL During Authentication Changes

DNS changes do not appear everywhere instantaneously.

When planning a migration, lower TTL in advance where appropriate, make the change, verify it, and restore a normal stable TTL afterward.

For DNS fundamentals, continue with our DNS Configuration Best Practices.


36. Do Not Delete Existing TXT Records Blindly

A domain can have several TXT records serving different purposes.

Examples include:

  • SPF.
  • DKIM.
  • Site verification.
  • Service ownership verification.

Deleting unrelated TXT records can break other services.


37. Verify the Hostname Field in Your DNS Panel

DNS providers present record names differently.

For a DKIM hostname such as:

selector1._domainkey.example.com

one panel may expect:

selector1._domainkey

while another interface may display the full hostname.

Confirm that the final DNS name is correct after saving.


38. Common SPF Failure: Missing Third-Party Sender

Example:

Business email provider → authorized

Newsletter platform → forgotten

Result:
Newsletter SPF may fail

39. Common DKIM Failure: Wrong Selector

If the sender signs using one selector but DNS contains a key under another selector, the receiver cannot retrieve the expected public key.

Check the message's DKIM signature and compare its selector with DNS.


40. Common DKIM Failure: Modified Message

Mail gateways, forwarding systems, or security tools can sometimes modify signed portions of a message.

Depending on what was signed and modified, the DKIM signature can fail verification.


41. Common DMARC Failure: Authentication Passes but Alignment Does Not

For example:

Visible From:
[email protected]

DKIM signs:
mailer.vendor-example.net

SPF authenticates:
bounce.vendor-example.net

Result:
Authentication may pass,
but DMARC alignment can fail.

The email provider should normally offer a custom-domain authentication configuration to solve this.


42. DMARC Aggregate Reports

Aggregate reports can help identify:

  • Sending IPs.
  • SPF results.
  • DKIM results.
  • Alignment.
  • Potential unauthorized sources.

They are especially useful before increasing enforcement.

External rua/ruf destinations need authorization

If the reporting mailbox is outside the domain publishing the DMARC policy, current DMARC reporting rules require additional DNS authorization at the report-consumer domain for conforming receivers to send reports there.

Conceptually, if example.com requests reports at [email protected], the report consumer publishes an authorization TXT record under a name shaped like:

example.com._report._dmarc.thirdparty.example.net
TXT "v=DMARC1;"

Use the exact hostname required by the reporting provider rather than copying this example literally.


43. Use a Dedicated DMARC Reporting Address

DMARC XML reports can be machine-oriented and numerous.

A dedicated address or reporting service can keep them separate from normal business email.


44. Do Not Jump from No DMARC to Reject Without Observation

A safer operational progression is:

Inventory senders
      ↓
Configure SPF + DKIM
      ↓
DMARC p=none
      ↓
Review reports
      ↓
Fix alignment
      ↓
Gradual enforcement
      ↓
Quarantine / Reject if appropriate

45. Subdomains

Large organizations may send different types of mail from separate subdomains.

For example:

example.com
mail.example.com
news.example.com
transactional.example.com

This can separate sending streams and authentication configurations, but it also increases DNS and operational complexity.

Use sp= and np= deliberately

DMARC supports sp= for existing subdomains of the organizational domain. RFC 9989 also defines np= for non-existent subdomains. If np is absent, the applicable sp or parent p policy is used. Do not add strict subdomain policy until legitimate subdomain senders are inventoried.


46. Marketing and Transactional Mail Should Be Treated Differently

Marketing and transactional email have different user expectations and operational characteristics.

Keeping them logically separated can make:

  • Reputation monitoring.
  • Authentication.
  • Complaint analysis.
  • Operational troubleshooting.

easier.


47. Authentication Does Not Guarantee Inbox Placement

A message can pass SPF, DKIM, and DMARC and still be:

  • Delivered to spam.
  • Rate limited.
  • Rejected for another reason.

Authentication is one important part of the sender-quality system.


48. Spam Complaint Rates Matter

Mailbox providers evaluate whether recipients actually want the messages they receive.

Do not treat technical authentication as permission to send unsolicited bulk email.

Use:

  • Clear opt-in practices.
  • Relevant content.
  • Functional unsubscribe mechanisms where required.
  • Reasonable sending volume.

49. Current Gmail and Yahoo Sender Requirements

Mailbox-provider rules change, so verify their official sender documentation regularly. As of September 25, 2026, the following requirements are current for mail sent to Gmail and Yahoo users.

Gmail

  • All senders to personal Gmail accounts must use SPF or DKIM.
  • Senders sending about 5,000 or more messages per day to personal Gmail accounts are treated as bulk senders; Google counts traffic across the same primary domain.
  • Bulk senders must use both SPF and DKIM and publish DMARC; p=none is permitted as the minimum DMARC policy.
  • For direct mail, the visible From domain must align with either the SPF organizational domain or DKIM organizational domain.
  • Google requires valid forward and reverse DNS, TLS and RFC-compliant message formatting.
  • Marketing and promotional messages from bulk senders must support one-click unsubscribe and include a visible unsubscribe link.
  • Google says senders should keep user-reported spam below 0.1% and prevent it from reaching 0.3% or higher.
  • Google's current FAQ says bulk-sender classification does not expire once assigned.
  • Google is actively enforcing the requirements; non-compliant traffic can experience spam placement, temporary failures or permanent rejections depending on the issue.

See Google’s current email sender guidelines and sender FAQ.

Yahoo

  • All senders must authenticate with SPF or DKIM at minimum.
  • Bulk senders must use both SPF and DKIM and publish a valid DMARC policy with at least p=none.
  • For DMARC, the From domain must align with either the SPF or DKIM domain; relaxed alignment is acceptable.
  • Yahoo requires valid forward and reverse DNS for sending IPs and RFC-compliant messages.
  • Marketing/subscription mail must provide easy unsubscribe support.
  • Yahoo instructs senders to keep spam complaint rates below 0.3%.

Yahoo does not publish a fixed numerical bulk-sender threshold in its current FAQ. See the current Yahoo Sender Requirements.

These are provider-specific operational requirements, not a universal legal standard for all email systems.


50. TLS and Email Authentication Solve Different Problems

TLS protects mail while it is transmitted between compatible mail systems.

SPF, DKIM, and DMARC authenticate domain identity and policy.

You generally need both transport security and authentication.


51. Verify DNS Before Reading Message Headers

Confirm what public DNS actually returns after saving records:

# SPF
dig +short TXT example.com

# DKIM
dig +short TXT selector1._domainkey.example.com

# DMARC
dig +short TXT _dmarc.example.com

If your DNS panel automatically appends the zone name, verify the final public hostname instead of trusting only how the control panel displays the host field.


52. Diagnose Using Message Headers

When mail reaches a test mailbox, inspect the authentication results in the message headers.

Look for results such as:

spf=pass
dkim=pass
dmarc=pass

Then confirm which domains actually authenticated and aligned.


53. Test Each Sending System Separately

Do not test only your normal mailbox and assume every platform is authenticated.

Send test messages independently from:

  • Website contact form.
  • WooCommerce.
  • Newsletter provider.
  • CRM.
  • Support desk.
  • Business mailbox.

54. Email Authentication Deployment Workflow

  1. Inventory every legitimate sender.
  2. Review existing DNS TXT records.
  3. Create one valid SPF policy covering legitimate senders.
  4. Enable DKIM for each sending platform.
  5. Verify SPF and DKIM using real test messages.
  6. Publish DMARC with monitoring/reporting.
  7. Review aggregate reports.
  8. Fix unknown or misaligned senders.
  9. Verify PTR and TLS where relevant.
  10. Gradually increase DMARC enforcement when appropriate.
  11. Continue monitoring after changes.

55. Related DNS and Email Infrastructure Path

This guide belongs within the DNS and infrastructure cluster:

DNS Configuration
      ↓
SPF / DKIM / DMARC
      ↓
Email Infrastructure
      ↓
Hosting / VPS Architecture

This is an infrastructure and authentication topic. It does not need unrelated VPN, themes, B2B prospecting, package forwarding, or general SaaS affiliate links.


Summary: SPF, DKIM & DMARC Checklist

  • Inventory every platform sending mail for your domain.
  • Publish only one valid SPF policy per domain.
  • Include every legitimate SPF sender.
  • Watch SPF DNS lookup complexity.
  • Enable DKIM for every supported sender.
  • Protect DKIM private keys.
  • Use modern key lengths supported by your provider.
  • Rotate DKIM selectors when appropriate.
  • Understand DMARC alignment.
  • Start DMARC with monitoring rather than blind enforcement.
  • Review aggregate reports.
  • Correct unauthorized and misaligned senders.
  • Use quarantine/reject only after validation.
  • Verify forward and reverse DNS on self-managed mail infrastructure.
  • Use TLS.
  • Test every sending platform independently.
  • Inspect real message authentication headers.
  • Do not claim authentication guarantees inbox placement.
  • Monitor current mailbox-provider requirements for bulk sending.
DNS Next Step

Verify the DNS Layer Before Troubleshooting Mail Delivery

SPF, DKIM and DMARC depend on accurately published DNS records. Verify record names, TXT values, TTLs, A/AAAA records and any migration changes before changing mail-server configuration.

Review DNS Configuration →

Frequently Asked Questions

Do I need SPF, DKIM and DMARC?

For a production domain, configuring all three is a strong baseline. Some mailbox providers require different minimum combinations depending on sending volume, so check their current sender requirements as well.

What is the SPF 10-lookup limit?

RFC 7208 limits SPF evaluation to 10 DNS-querying terms such as include, a, mx, ptr, exists and redirect. Exceeding the limit causes SPF permerror.

What does DMARC alignment mean?

DMARC alignment means the domain authenticated by SPF or DKIM has the required relationship with the domain users see in the From header. A message can pass SPF or DKIM authentication and still fail DMARC if the authenticated domain does not align.

Does SPF prevent email spoofing?

SPF helps receivers evaluate whether the envelope sender used authorized infrastructure, but SPF alone does not fully protect the visible From address. DMARC adds domain-alignment checks and policy.

Can I have two SPF records?

You should not publish multiple independent SPF policies for the same domain. Legitimate sending sources generally need to be represented within one valid SPF record.

What is a DKIM selector?

A selector identifies which DKIM public key a receiver should retrieve from DNS. It allows multiple keys and makes key rotation possible.

Should I use DMARC p=reject immediately?

Usually not on an existing production domain unless every legitimate sender has already been audited and authenticated. Start with monitoring, review reports, fix alignment, and move toward enforcement carefully.

Can SPF pass while DMARC fails?

Yes. SPF can authenticate successfully while the authenticated domain does not align with the visible From domain, causing SPF not to satisfy DMARC.

Can email pass DMARC if SPF fails?

Yes. An aligned DKIM signature can satisfy DMARC even when SPF fails.

Do SPF, DKIM and DMARC guarantee email delivery?

No. They strengthen authentication and domain protection, but inbox placement also depends on factors such as sender reputation, complaint rates, DNS, TLS, message quality and sending behavior.

Abdul Shakoor
Written by

Abdul Shakoor

Founder of Digital Bhatti, an independent technical publication focused on web hosting and infrastructure, WordPress, technical SEO, web performance and automation.