Email Security Best Practices: SPF, DKIM, DMARC, and Beyond

Published March 22, 2026 - 18 min read

A finance director at a 300-person manufacturing company receives an email from the CEO requesting an urgent wire transfer of $187,000 to close an acquisition. The email comes from the CEO's exact email address, matches his writing style, and references a real deal the company has been working on. The finance director initiates the transfer. The money disappears into a network of overseas accounts. The CEO never sent the email.

This is business email compromise (BEC), and it cost organizations $2.9 billion in 2025 alone. It works because most organizations have not implemented the email authentication protocols that would have prevented the CEO's email address from being spoofed in the first place. SPF, DKIM, and DMARC are not new technologies - they have existed for over a decade. But only 33% of domains have a DMARC policy set to reject, meaning two-thirds of organizations are still vulnerable to exact-domain spoofing attacks.

This guide covers the three foundational email authentication protocols, how to implement each one correctly, and the additional measures you need to build a comprehensive email security posture. If your organization sends email (and it does), this is not optional.

Why Email Authentication Matters

Email was designed in the 1970s and 1980s without any built-in authentication. The Simple Mail Transfer Protocol (SMTP) trusts whatever the sending server claims about who sent the message. There is no verification of identity, no validation of the sender's authority to use a domain, and no integrity check on the message contents. Anyone can send an email claiming to be from any address.

This architectural weakness is what makes phishing, spoofing, and business email compromise possible. The three authentication protocols - SPF, DKIM, and DMARC - were developed to retroactively add the authentication that SMTP lacks. Together, they answer three questions that SMTP cannot: Is this server authorized to send mail for this domain? Was this message altered in transit? What should I do if authentication fails?

SPF: Sender Policy Framework

How SPF Works

SPF allows domain owners to publish a DNS TXT record that lists every IP address and mail server authorized to send email on behalf of their domain. When a receiving mail server gets a message claiming to be from your domain, it checks your SPF record. If the sending server's IP address is in the list, SPF passes. If not, SPF fails.

Setting Up SPF

An SPF record is a DNS TXT record published at your domain root. Here is a typical example:

v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.50 -all

Breaking this down:

Common SPF Mistakes

DKIM: DomainKeys Identified Mail

How DKIM Works

DKIM adds a cryptographic signature to every outgoing email. The sending mail server signs the message headers and body using a private key, then adds the signature to the email header. The corresponding public key is published as a DNS TXT record. Receiving servers retrieve the public key, verify the signature, and confirm that the message was not altered after the sender signed it.

DKIM proves two things: the message was sent by someone with access to the domain's private key (authenticity), and the message was not modified in transit (integrity). Unlike SPF, which only validates the sending server, DKIM validates the message itself.

Setting Up DKIM

DKIM requires two components: configuring your mail server or email service to sign outgoing messages with your private key, and publishing the corresponding public key as a DNS TXT record.

For Google Workspace, the setup involves generating a DKIM key in the Admin Console and adding the provided TXT record to your DNS. For Microsoft 365, DKIM is configured in the Exchange admin center with CNAME records pointing to Microsoft's DKIM infrastructure. For third-party services like SendGrid, each service provides its own DKIM configuration - typically a CNAME record that delegates DKIM signing to their infrastructure.

A DKIM DNS record looks like this:

selector1._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ..."

DKIM Best Practices

DMARC: Putting It All Together

How DMARC Works

DMARC builds on SPF and DKIM by adding two critical capabilities: alignment checking and policy enforcement. Alignment means the domain in the From header (what the recipient sees) must match the domain authenticated by SPF or DKIM. Without DMARC, an attacker could pass SPF using their own domain while spoofing your domain in the From header. DMARC closes this gap.

DMARC also specifies what receiving servers should do when authentication fails: nothing (monitor only), quarantine (send to spam), or reject (block entirely). And it provides a reporting mechanism that sends aggregate and forensic data back to the domain owner, giving visibility into who is sending email using your domain - both legitimate services and attackers.

Implementation Roadmap

DMARC implementation should follow a phased approach over 3-6 months:

  1. Phase 1 - Monitor (4-8 weeks). Publish a DMARC record with p=none to collect data without affecting email delivery. Analyze aggregate reports to identify all legitimate email sources and ensure they pass SPF or DKIM with alignment.
  2. Phase 2 - Quarantine (4-8 weeks). Move to p=quarantine to send failing messages to spam. Start with pct=25 to apply the policy to only 25% of failing messages, then increase to 50%, 75%, and 100% as you verify no legitimate email is affected.
  3. Phase 3 - Reject. Move to p=reject to block all unauthenticated email. This is the goal state that provides full protection against domain spoofing.

A complete DMARC record for the monitoring phase:

_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:dmarc-forensics@yourdomain.com; fo=1; adkim=r; aspf=r"
The most common DMARC failure is jumping straight to p=reject without the monitoring phase. Organizations discover too late that their CRM, marketing platform, payroll provider, or invoice system sends email from their domain without proper SPF or DKIM alignment. Those emails get blocked, and the IT team spends a chaotic week trying to identify every service that sends email on behalf of the company. The monitoring phase prevents this entirely.

Reading DMARC Reports

DMARC aggregate reports arrive as XML files that are difficult to read manually. Use a DMARC report analyzer - free options include DMARC Analyzer, URIports, and MXToolbox DMARC Report Analyzer. These tools parse the XML into readable dashboards showing which IP addresses send email for your domain, whether they pass SPF and DKIM, and which messages fail authentication.

Focus on three things in your reports: legitimate sources that fail authentication (these need SPF or DKIM configuration fixes), unknown sources sending high volumes (potential spoofing or unauthorized use of your domain), and the overall authentication pass rate (target 98%+ before moving to reject).

Beyond Authentication: Additional Email Security Measures

Anti-Phishing Controls

Authentication protocols stop domain spoofing but not all phishing techniques. Additional controls include:

Email Encryption

Authentication ensures that emails are from who they claim to be. Encryption ensures that only the intended recipient can read them. The two address different threats and both are necessary for sensitive communications.

Business Email Compromise Prevention

BEC deserves special attention because it bypasses technical controls by exploiting human trust. The attacker does not need to breach your systems - they just need one employee to believe a fraudulent request is legitimate. Prevention requires both technical and procedural controls:

Implementation Checklist

  1. Audit every service that sends email using your domain (marketing, CRM, helpdesk, transactional, HR, billing, notifications)
  2. Publish an SPF record including all legitimate senders; verify with -all enforcement
  3. Configure DKIM signing on your primary mail platform and every third-party sender
  4. Publish a DMARC record at p=none and monitor aggregate reports for 4-8 weeks
  5. Fix any legitimate sources that fail SPF or DKIM alignment
  6. Advance DMARC to p=quarantine, then p=reject over the next 2-4 months
  7. Configure external sender banners and executive impersonation protection
  8. Enable link scanning and attachment sandboxing in your email security gateway
  9. Enforce TLS for email in transit; consider MTA-STS for strict enforcement
  10. Establish out-of-band verification procedures for all financial requests
  11. Deploy security awareness training focused on phishing and BEC recognition
  12. Review DMARC reports monthly and audit SPF records quarterly
The order matters. Implement SPF and DKIM before DMARC. Implement DMARC at none before quarantine. Implement quarantine before reject. Each phase depends on the previous one being correctly configured. Skipping steps creates email delivery failures that erode IT's credibility and make stakeholders resistant to further security improvements.

Testing Your Configuration

After implementation, verify your setup using these free tools:

Run these checks quarterly and after any changes to your email infrastructure, DNS records, or third-party email services. A single misconfigured SPF include or an expired DKIM key can silently undermine your entire authentication posture.

Get IT Support Insights Delivered Weekly

Practical tips for IT teams - troubleshooting guides, cost-saving strategies, and tool reviews. No spam, unsubscribe anytime.

Ready to automate your IT support?

HelpBot resolves 60-70% of Tier 1 tickets automatically. 14-day free trial - no credit card required.

Start Free Trial

Automate Email Security Tickets

HelpBot handles SPF/DKIM/DMARC troubleshooting, email delivery investigations, and quarantine release requests automatically. Reduce email-related tickets by 40% while improving response times from hours to seconds.

Start Free Trial

Back to Home

Still managing IT tickets manually?

See how HelpBot can cut your ticket resolution time by 70%. Free ROI calculator included.

Calculate Your ROIStart Free Trial