Troubleshoot Sender ID Filtering and SPF PermError in Exchange Online Protection
Question details
Determine why Sender ID filtering does not appear to apply to messages with SPF errors in Exchange Online Protection.

- Product
- Microsoft 365 Exchange Online Protection
- Device & OS
- not provided
- Scenario
- An administrator is investigating messages with SPF errors and no DKIM or DMARC policy.
- Observed behavior
- Sender ID filtering does not appear to be applied to the affected messages.
Sign in with an account that can view Microsoft 365 security policies, and obtain the full headers of an affected message. Note the recipient, receiving time, and sending domain so you can identify the applicable policy and SPF record.
Review the Anti-Spam Policy and Advanced Spam Filtering Settings
Use this approach to check whether the relevant filtering option is enabled and whether the policy applies to the recipient.
In the Microsoft Defender portal, go to Email & collaboration > Policies & rules > Threat policies > Anti-spam policies.
Open the inbound anti-spam policies and review their recipients, exclusions, and priority to determine which policy applies to the affected recipient.
Open the applicable policy's advanced spam filtering settings and check the Sender ID or SPF-related options available in your tenant. Record whether each relevant option is enabled and its configured action.
Open the affected message's full headers and look for X-CustomSpam, Authentication-Results, and X-Forefront-Antispam-Report. An X-CustomSpam value can identify a matched Advanced Spam Filtering option; for example, it may name an option such as image links to remote sites.

Investigate the Sending Domain's SPF PermError
Use this approach to identify an SPF record problem that may be preventing a normal SPF evaluation.
Document Your Email Security Investigation With WPS Office
WPS Office is a free, lightweight, easy-to-use Office alternative for documenting policy settings and organizing troubleshooting notes. Its familiar interface and Microsoft Office format compatibility make it easy to move existing documents into your workflow. It does not replace or configure Exchange Online Protection.

Frequently Asked Questions
Does SPF PermError mean the sender failed SPF?
No. PermError means SPF evaluation encountered a permanent error, such as invalid record syntax or too many DNS lookups. It is distinct from an SPF hard-fail result.
Where can I find the Advanced Spam Filtering settings?
In the Microsoft Defender portal, go to Email & collaboration > Policies & rules > Threat policies > Anti-spam policies, then open the applicable inbound policy and review its advanced filtering settings.
What does the X-CustomSpam header tell me?
X-CustomSpam can identify an Advanced Spam Filtering option that a message matched. Compare its value with the enabled options in the policy that applies to the recipient.
Does the absence of DKIM or DMARC explain the Sender ID filtering result?
Not by itself. Review the message's Authentication-Results header, the applicable anti-spam policy, and the specific advanced filtering setting before drawing a conclusion.
What should I share for further diagnosis?
Share the relevant anti-spam policy configuration or a screenshot of its advanced filtering settings, along with the affected message headers. Remove sensitive information before sharing.




