Security Policy Errors

Block a Sender by Display Name with an Exchange Online Mail Flow Rule

Adam DavisAdam Davis Nov 25, 2026 868 views

Question details

Create a mail flow rule that blocks messages based on a sender's display name or a matching text pattern.

Block a Sender by Display Name in Exchange Online
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.
Before you start

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.

Solution 1Recommended

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.

1
Create a rule

In the Exchange admin center, go to Mail flow > Rules, select Add a rule, and choose Create a new rule.

2
Choose the sender property

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.

3
Enter the name pattern

Select the DisplayName property, enter the text pattern to match, and confirm the condition.

4
Set the action and test

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 Sender's Directory Display Name
Test before enforcement: A broad pattern can match legitimate senders. Review rule results and narrow the pattern or add exceptions before switching the rule to enforcement.
Free Microsoft Office alternative

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.

Free, lightweight office suite with a familiar interfaceCompatible with Microsoft Word, Excel, and PowerPoint formatsOpen and edit existing Office files when moving between applicationsDocument mail flow rule settings and test results in Writer or Spreadsheets
microsoft office alternative - wps office

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.