Suped

Troubleshooting Office 365 DKIM and SPF email authentication failures

Michael Ko profile picture
Michael Ko
Co-founder & CEO, Suped
Published 8 Aug 2025
Updated 19 Aug 2025
5 min read
Email authentication failures, especially with Office 365 (Microsoft 365), can be incredibly frustrating. When emails fail SPF (Sender Policy Framework) or DKIM (DomainKeys Identified Mail) checks, it often means your messages are landing in spam folders or being rejected outright. This impacts your communication and reputation, but pinpointing the exact cause can be challenging.
Many factors can contribute to these authentication failures. Sometimes it's a misconfigured DNS record, other times it's a more nuanced issue with how Office 365 processes mail. Understanding the underlying mechanisms of these protocols and how Microsoft interacts with them is key to effective troubleshooting.
I'll guide you through common pitfalls and provide practical steps to diagnose and resolve Office 365 SPF and DKIM authentication issues, helping ensure your emails reach their intended recipients.
Suped DMARC monitoring
Free forever, no credit card required
Learn more
Trusted by teams securing millions of inboxes
Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo

Understanding SPF and DKIM fundamentals in Microsoft 365

SPF and DKIM are fundamental email authentication standards. SPF verifies that emails originate from IP addresses authorized by the sending domain's owner, while DKIM provides a digital signature to confirm that the email content hasn't been tampered with in transit.
For Microsoft 365 (Office 365), proper configuration of these records in your domain's DNS is critical. An SPF record is a TXT record that lists authorized sending servers. A typical SPF record might look like "v=spf1 include:spf.protection.outlook.com -all". DKIM involves publishing two CNAME records provided by Microsoft into your DNS, allowing receiving servers to retrieve the public key to verify the signature.
Microsoft's own documentation highlights the importance of correct email authentication for security. According to Microsoft Defender for Office 365, scenarios where the domain in the SPF record or DKIM signature doesn't match the "From" address can lead to message failures. Without these, your domain's email could be treated as suspicious, impacting your overall email deliverability.

Common causes of SPF and DKIM failures

One of the most common reasons for SPF failures, particularly a soft fail (which means the email might still be delivered but marked as suspicious), is an improperly configured SPF record. This could be due to exceeding the 10-DNS-lookup limit or not including all legitimate sending IP addresses or services. An SPF "soft fail" (represented by ~all) suggests that the email may not be authorized, but it's not strictly rejected, as detailed in this guide on SPF validation.
DKIM failures are often more complex. A common issue is the DKIM signature not verifying, sometimes due to intermittent issues with Office 365 itself or content modification during transit. This can happen if an email passes through an intermediary service that alters the message body or headers after the DKIM signature is applied, invalidating the signature. For instance, sometimes Microsoft's own internal processing can interfere.
Another specific DKIM issue for Office 365 users is when the signature fails for Microsoft domains but passes for others like Gmail. This suggests an internal handling problem within Microsoft's email infrastructure. Troubleshooting these issues requires a systematic approach to examine DNS records and email headers closely.

Practical troubleshooting steps

When facing SPF and DKIM authentication failures in Office 365, a structured troubleshooting approach is essential. The first step is always to verify your DNS records, as most authentication issues stem from incorrect or missing entries.
After confirming your DNS records, the next crucial step is to analyze the email headers of failed messages. These headers contain a wealth of information about the journey of an email and its authentication results. By examining the Authentication-Results header, you can see exactly where the SPF and DKIM checks failed and why. This is a primary method to troubleshoot SPF and DMARC settings.

Checking SPF configuration

  1. Verify SPF record syntax: Ensure your SPF record is correctly formatted and includes microsoft.com logoinclude:spf.protection.outlook.com. One SPF record per domain.
  2. Check DNS lookup limit: SPF records have a 10-DNS-lookup limit. Exceeding this often causes failures. Consolidate include statements or use a flat SPF record if necessary. This can be a hidden SPF DNS timeout problem.
  3. Review email headers: Look for the Received-SPF header to see the result (pass, fail, softfail) and the IP address that was checked.

Checking DKIM configuration

  1. Verify DKIM CNAME records: Ensure the two CNAME records provided by Office 365 are correctly published in your DNS. These typically look like selector1._domainkey and selector2._domainkey.
  2. Check email headers for DKIM status: Look for the DKIM-Signature and Authentication-Results headers. A dkim=fail typically indicates a signature mismatch or a problem with the public key. More on troubleshooting DKIM failures.

Advanced considerations and troubleshooting

Sometimes, the problem isn't just about static DNS records. Intermittent failures can point to more dynamic issues within the email flow. For instance, if emails are internally forwarded within Microsoft 365, this can sometimes lead to issues where the system tries to evaluate SPF against an internal IP address rather than the original sending IP. This can cause SPF soft fails and other authentication anomalies.
Another advanced consideration is how the email body or headers might be altered during transit, affecting DKIM. Encoding issues, especially with special characters, can break DKIM signatures, as the receiving server's hash calculation won't match the original. Additionally, certain sending platforms or configurations might introduce issues. For more specific insights into why Microsoft DKIM signatures are failing, a deep dive into message headers is often necessary.

SRS and DMARC

Sender Rewriting Scheme (SRS) is sometimes suggested for forwarding scenarios to ensure SPF passes. However, SRS can interfere with DKIM and DMARC alignment, especially if your emails aren't signed with an aligned DKIM key. While it re-writes the "Return-Path" (envelope sender), it doesn't solve the underlying DKIM or "From" header alignment issues, potentially breaking DMARC.

Resolving internal forwarding issues

If emails are forwarding internally within Microsoft 365, Microsoft's systems should ideally ignore internal hops for authentication purposes. If SPF is failing against an internal IP within Outlook's hops, this suggests an internal configuration issue rather than an SRS requirement. Focus on ensuring Microsoft's internal mail flow correctly handles authentication for forwarded messages.

Views from the trenches

Best practices
Ensure SPF records are up-to-date and include all legitimate sending sources for your domain.
Verify that DKIM CNAME records are accurately published in your DNS and activated in Office 365.
Regularly monitor your DMARC reports to catch authentication failures early and identify patterns.
Common pitfalls
Exceeding the 10-DNS-lookup limit in your SPF record, leading to SPF failures or timeouts.
Incorrectly published DKIM CNAME records, preventing signature verification.
Content modifications by intermediate mail services breaking DKIM signatures.
Expert tips
"If DKIM passes elsewhere but fails for Office 365, it often indicates an internal Microsoft processing issue, such as them modifying the message body or headers."
"Be cautious with email forwarding: If emails are forwarded inside Microsoft's infrastructure, they should ideally bypass internal handoffs for authentication to prevent breaking DMARC."
"Avoid starting a line with a period in email content. I've found this can sometimes interfere with DKIM signing and authentication specifically with Microsoft MTAs."
Marketer view
Marketer from Email Geeks says they have encountered problems with Office 365 failing DKIM and soft failing SPF in the past, suggesting that Microsoft has had internal issues.
2019-07-09 - Email Geeks
Expert view
Expert from Email Geeks says that when Office 365 shows an SPF soft fail against an internal IP and not the originating IP, it indicates Microsoft is pulling the wrong IP out of the headers for SPF evaluation.
2019-07-09 - Email Geeks

Final thoughts on email authentication with Microsoft 365

Resolving SPF and DKIM authentication failures in Office 365 is a critical step towards achieving consistent email deliverability. By systematically checking your DNS records, carefully analyzing email headers, and understanding the nuances of Microsoft's mail processing, you can diagnose and fix most common issues.
Remember, email authentication is an ongoing process. Regular monitoring and staying informed about changes in email standards, especially those implemented by major mailbox providers, will help maintain a healthy sending reputation and ensure your messages reliably reach the inbox.

Frequently asked questions

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard

What you'll get with Suped

Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing