Investigate Exchange Emails Quarantined Before Mail Flow Rules Run
Question details
Determine why Exchange messages are quarantined before the expected mail flow rule appears to apply.

- Product
- Microsoft Exchange Online and Microsoft Defender for Office 365
- Device & OS
- not provided
- Scenario
- An administrator wants a mail flow rule to match messages from specific senders or domains and investigate why those messages reach quarantine instead.
- Observed behavior
- Affected messages are quarantined, and the expected mail flow rule does not appear to run.
Identify an affected message, its sender, recipient, and approximate delivery time. Sign in with permissions to view message traces, mail flow rules, quarantine details, and anti-spam policies.
Compare message headers with the Exchange mail flow rule
Use this approach to determine whether the rule is checking a different sender field from the one present in the message.
In the Microsoft Defender portal, go to Email & collaboration > Review > Quarantine. Select an affected message and view its details and message headers.
In the full headers, compare the From, Sender, and Reply-To values. Note whether the Sender header is present and which address or domain the rule is intended to match.
In the Exchange admin center, open Mail flow > Rules and select the relevant rule. Compare its sender or message-header condition with the values you found in the message headers.
If the Sender header contains the intended value, test a rule using the condition that matches a message header against text patterns. Specify Sender as the header and enter a pattern for the intended address or domain. Use a test mode if available.
Open Mail flow > Message trace in the Exchange admin center and search for the affected sender, recipient, and time range. Review the trace details and available rule reports for evidence of the rule's evaluation.

Review the anti-spam policy and quarantine action
Use message trace and quarantine details to identify whether a security policy acted before the expected rule could affect delivery.
Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations. Its familiar interface and Office format compatibility make it easy to move existing files, although it does not resolve Exchange quarantine or mail flow policy issues.

Frequently Asked Questions
Why might a sender-based rule fail to match a quarantined message?
The rule may be checking a sender value different from the one you expect, or a security policy may have quarantined the message. Compare the From, Sender, and Reply-To headers with the condition under Exchange admin center > Mail flow > Rules.
Where can I find the reason a message was quarantined?
In the Microsoft Defender portal, go to Email & collaboration > Review > Quarantine. Select the message and inspect its quarantine reason and available policy details.
How do I check what happened to a message in Exchange?
Open Exchange admin center > Mail flow > Message trace. Search using the sender, recipient, and relevant time range, then open the result to inspect its recorded events and delivery status.
How do I match either of two sender patterns in a rule?
When using a condition that accepts regular expressions, separate alternatives with a pipe character (|). Test the complete expression against the intended values before relying on it.
Will adding a sender to a safe sender list prevent all quarantine actions?
Not necessarily. The result depends on the list, policy, and security verdict. Test any permitted change with a controlled message and review the resulting quarantine details and message trace.




