Best Practices for Email Authentication
Email authentication is one of the most important aspects of ensuring the integrity and trustworthiness of your email marketing campaigns. Not only does it help protect your domain from being used by malicious actors, but it also enhances your deliverability and reduces the likelihood of your emails landing in the spam folder. To achieve email authentication, three key standards are commonly implemented: SPF, DKIM, and DMARC. Together, they ensure that your emails are legitimate and safe for recipients to open.
In this article, we'll explore the importance of these three protocols, how they work, and best practices for implementing them to improve your email security and deliverability.
1. What is SPF (Sender Policy Framework)?
SPF is an email authentication protocol that helps verify whether an email is being sent from an authorized server. Essentially, SPF allows the owner of a domain to specify which mail servers are permitted to send emails on behalf of their domain. When a recipient’s email server receives an email, it checks the SPF record to ensure the email is coming from a trusted source.
Best Practices for SPF:
Create an SPF Record: Your SPF record is a DNS (Domain Name System) record that lists all IP addresses or mail servers authorized to send emails for your domain. This record should be added to your DNS settings.
Limit the Number of Lookups: SPF has a limit on the number of DNS lookups it can perform. A typical best practice is to keep this limit under 10 to avoid SPF failures.
Regularly Review and Update: As you add new email service providers (ESPs) or change your email infrastructure, update your SPF record accordingly to reflect these changes.
Use the “-all” Mechanism: The “-all” mechanism at the end of your SPF record ensures that only the listed servers are authorized to send emails on your behalf. It marks emails sent from unauthorized servers as failures.
For example:
This record specifies that emails sent from IP 192.168.0.1
or example.com
are authorized, and all other sources are not.
2. What is DKIM (DomainKeys Identified Mail)?
DKIM is another email authentication protocol that adds a digital signature to each outgoing email. The signature is associated with your domain and ensures the recipient can verify that the email has not been altered during transit. DKIM operates by attaching a unique cryptographic signature to the header of your email. This signature can be verified by the receiving server by checking it against your public DKIM key, which is published in your domain’s DNS records.
Best Practices for DKIM:
Generate a DKIM Key Pair: DKIM requires two keys: a private key (held by the sender) and a public key (published in DNS). The private key signs your outgoing emails, and the public key is used by recipients to verify the signature.
Publish the DKIM Public Key: Ensure that your DKIM public key is correctly published in your domain’s DNS records. This allows receiving servers to authenticate the signature.
Use Strong Encryption: To ensure the security of the DKIM signatures, use a strong encryption algorithm (e.g., RSA 2048-bit or stronger).
Monitor DKIM Reports: Many email service providers offer DKIM reports that help you monitor authentication failures and troubleshoot any issues with your DKIM setup.
For example, a DKIM signature might look like this:
3. What is DMARC (Domain-based Message Authentication, Reporting & Conformance)?
DMARC is a policy framework that builds upon SPF and DKIM to provide domain owners with more control over their email authentication processes. It allows you to specify how your domain handles email that fails SPF or DKIM checks. DMARC also enables you to receive reports about the status of email sent using your domain, helping you track and improve your email authentication setup.
DMARC gives domain owners the ability to specify whether emails that fail authentication checks should be quarantined, rejected, or allowed through, thus adding an extra layer of protection against spoofing and phishing.
Best Practices for DMARC:
Create a DMARC Record: A DMARC record is added to your domain’s DNS settings and outlines the policy you want to enforce for emails that fail SPF or DKIM checks. It includes instructions on how to handle such emails and whether to receive reports.
Start with a “None” Policy: If you're new to DMARC, start with a policy of
p=none
, which means you’re just monitoring how your domain’s emails are performing. This allows you to analyze the impact without affecting your email delivery.Gradually Move to “Quarantine” or “Reject”: Once you're confident in your SPF and DKIM setup, move to more stringent DMARC policies like
p=quarantine
(send emails to spam/junk) orp=reject
(reject unauthorized emails).Review DMARC Reports Regularly: DMARC provides you with aggregate reports on email authentication activity. Regularly review these reports to identify any issues with your email authentication and make necessary adjustments.
For example, a DMARC record might look like this:
This record tells receiving servers to quarantine emails that fail DMARC checks, while also sending aggregate and failure reports to the specified email addresses.
4. Why Implement SPF, DKIM, and DMARC Together?
When used together, SPF, DKIM, and DMARC create a robust email authentication system that improves email security, protects your brand reputation, and ensures that your emails reach their intended recipients. While SPF verifies the sender's identity, DKIM ensures the integrity of the email's content, and DMARC specifies what should happen to unauthenticated emails.
By implementing all three protocols, you can:
Reduce the Risk of Email Spoofing: These protocols help prevent malicious actors from sending emails that appear to come from your domain.
Improve Deliverability: ISPs and email services like Gmail, Yahoo, and Outlook give preference to authenticated emails. This means your emails are less likely to end up in the spam folder.
Monitor Email Performance: DMARC reports help you track how your emails are being handled and provide insights into potential issues with your email campaigns.
Build Trust with Recipients: Email authentication signals to recipients that you’re a trusted sender, increasing the likelihood of your emails being opened.
5. Key Steps for Setting Up SPF, DKIM, and DMARC
Set Up SPF:
Log in to your DNS hosting provider.
Create an SPF record specifying which mail servers are authorized to send emails for your domain.
Set Up DKIM:
Generate a DKIM key pair (public and private).
Publish the public key as a DKIM record in your DNS.
Ensure that your email service provider or mail server signs outgoing emails with the private key.
Set Up DMARC:
Create a DMARC record that specifies how to handle emails that fail SPF or DKIM checks.
Start with a "none" policy to monitor your email performance, then move to stricter policies as you become more confident in your authentication setup.
Monitor and Adjust:
Regularly check DMARC reports to understand how your authentication setup is performing and identify areas that need improvement.
Adjust SPF, DKIM, and DMARC records as needed to enhance security and improve deliverability.
Email authentication protocols like SPF, DKIM, and DMARC are essential for ensuring the security, trustworthiness, and effectiveness of your email marketing efforts. By following best practices for each of these protocols, you can significantly improve your email deliverability, protect your domain from abuse, and build a more secure and reliable email marketing system.
Last updated
Was this helpful?