Black Friday Sale is live: save up to 85% on Web & WordPress HostingView Deals
Hosting & Server GlossarySecurity & Protection

Email Authentication Guide: SPF, DKIM, and DMARC Protocols Explained

What is Email Authentication?

Email authentication refers to a collection of technical standards designed to verify that an email message legitimately originated from the domain claiming to have sent it.

The original Simple Mail Transfer Protocol (SMTP) specification had no built-in mechanism to verify sender identity, allowing malicious actors to trivially forge the From: header in phishing and spoofing campaigns.

To eliminate this vulnerability, the internet standards community established a three-pillar authentication framework implemented through public Domain Name System (DNS) records:

  1. SPF (Sender Policy Framework)
  2. DKIM (DomainKeys Identified Mail)
  3. DMARC (Domain-based Message Authentication, Reporting, and Conformance)

1. SPF (Sender Policy Framework)

SPF is an identity validation standard published as a TXT record in your domain’s DNS zone. It explicitly enumerates all IP addresses, mail servers, and third-party gateways authorized to send mail on behalf of your domain:

Example SPF Record:

v=spf1 +a +mx +ip4:198.51.100.25 include:_spf.google.com ~all
  • v=spf1: Identifies the record as SPF version 1.
  • +a: Authorizes the IP address designated in the domain’s primary A record.
  • +mx: Authorizes all servers listed in the domain’s MX records.
  • +ip4:198.51.100.25: Authorizes a specific dedicated server IPv4 address.
  • include:_spf.google.com: Authorizes Google Workspace servers to send on the domain’s behalf.
  • ~all: Soft-fail policy indicating that unauthorized IPs should be treated with suspicion but not immediately discarded.

2. DKIM (DomainKeys Identified Mail)

DKIM uses asymmetric public-key cryptography to verify that email content was generated by an authorized sender and was not modified or tampered with in transit:

  1. When your mail server sends an email, it generates a unique cryptographic hash of the message headers and body.
  2. The server encrypts this hash using a private key stored securely on the sending server and attaches it to the email header (DKIM-Signature).
  3. The sending domain publishes the corresponding public key as a TXT record in DNS (e.g., default._domainkey.yourdomain.com).
  4. The recipient’s mail server retrieves the public key via DNS, decrypts the signature, recalculates the hash, and confirms that the message is authentic and unaltered.

3. DMARC (Domain-based Message Authentication)

While SPF and DKIM operate independently, DMARC unifies them into a comprehensive policy enforcement and reporting mechanism:

  1. Alignment: DMARC requires that the domain verified by SPF or DKIM matches the human-readable “From” address visible to the end recipient.
  2. Policy Enforcement: DMARC instructs receiving mail servers what action to take if both SPF and DKIM authentication fail:
    • p=none: Monitor only; deliver the message normally and send diagnostic reports.
    • p=quarantine: Divert failed messages to the recipient’s spam/junk folder.
    • p=reject: Instruct receiving servers to drop and bounce the message completely.
  3. Reporting: Directs daily aggregate delivery reports to an email address of your choice (rua=mailto:dmarc-reports@your-domain), providing visibility into all systems sending mail under your brand.

Example DMARC Record:

v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc-reports@your-domain

Frequently Asked Questions

Why are SPF, DKIM, and DMARC now mandatory for major email providers?

Major mailbox providers (including Google and Yahoo) enforce strict sender requirements to protect users against phishing and identity forgery. Emails lacking valid SPF/DKIM alignment or DMARC policies face immediate rejection or automated spam folder placement.

What is the difference between SPF and DKIM?

SPF lists which IP addresses are authorized to send mail from your domain. DKIM attaches an asymmetric cryptographic signature to the email header that receiving servers verify against a public key published in your DNS.

What is the safest DMARC policy for a new domain?

Begin with a monitoring policy (p=none) and specify an aggregate reporting email (rua). This allows you to collect deliverability reports and ensure all legitimate outbound services pass authentication before upgrading to quarantine (p=quarantine) or full rejection (p=reject).

Need Technical Assistance?

Web Hosting Wale support is available 24/7. Tickets are typically answered within 10-15 minutes.

Open Support TicketView All Support Channels