Block a Sender by Display Name with an Exchange Online Mail Flow Rule
Question details
Create a mail flow rule that blocks messages based on a sender's display name or a matching text pattern.

- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- An administrator wants to filter messages using a sender display name rather than only an email address.
- Observed behavior
- Messages matching the chosen name pattern should be deleted without notifying the sender.
Sign in to the Exchange admin center with permission to manage mail flow rules. Identify whether the sender is in your organization's directory or is external, and choose a pattern that is unlikely to match legitimate senders.
Match a Sender's Directory Display Name
Use this method when Exchange can resolve the sender to a directory entry with a display name.
The sender property condition checks directory attributes; it may not match an external sender who has no corresponding directory entry.
In the Exchange admin center, go to Mail flow > Rules, select Add a rule, and choose Create a new rule.
Name the rule. Under Apply this rule if, select The sender > has specific properties matching these text patterns. If necessary, select More options to see the condition.
Select the DisplayName property, enter the text pattern to match, and confirm the condition.
Under Do the following, select Block the message > delete the message without notifying anyone. Save the rule in a test mode first, if available, and check matches against both intended and legitimate messages before enforcing it.

Match a Display Name in the From Header
Use a header pattern when filtering external messages whose senders may not have directory entries.
Work with Office Files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents. It supports common Microsoft Office formats for an easier move between applications; Exchange Online mail flow rules must still be managed in the Exchange admin center.

Frequently Asked Questions
Where do I create an Exchange Online mail flow rule?
In the Exchange admin center, go to Mail flow > Rules, select Add a rule, and choose Create a new rule.
Will the sender property condition work for external senders?
The condition relies on directory attributes and may not match an external sender without a directory entry. For those messages, consider a From-header pattern and test it carefully.
Can I delete matching messages without notifying the sender?
Yes. Under Do the following, choose Block the message > delete the message without notifying anyone.
Why should I test a display-name rule before enforcing it?
A name pattern can match legitimate senders or other text in a From header. Use a test mode if available, review representative messages, and narrow the pattern or add exceptions before enforcement.




