Security Policy Errors

Block Unwanted Top-Level Domains in Exchange Online

Steven ParkerSteven Parker Nov 25, 2026 868 views

Question details

Block or reduce incoming spam from unwanted top-level domains in Office 365.

Block Unwanted Top-Level Domains in Exchange Online
Product
Microsoft Exchange Online
Device & OS
not provided
Scenario
An administrator wants to restrict email from top-level domains such as .top, .faith, .science, .ru, and .cn.
Observed behavior
Users receive large volumes of spam from these domains, and an allow-only TLD rule is not a practical fit for the requirement.
Before you start

Sign in with an account that can manage Exchange mail flow rules or anti-spam policies. Identify the TLDs or specific sender domains you want to block, and check whether legitimate correspondents use them.

Solution 1Recommended

Block selected TLDs with an Exchange Online mail flow rule

Use a sender-address pattern to target a defined list of unwanted TLDs without listing every domain individually.

This approach targets selected TLDs rather than creating an exhaustive allow-only list. Blocking an entire TLD can also affect legitimate messages.

1
Create a mail flow rule

Open the Exchange admin center at https://admin.exchange.microsoft.com, go to Mail flow > Rules, and select Add a rule > Create a new rule.

2
Set the sender pattern

Under Apply this rule if, select The sender > address matches any of these text patterns. Add the pattern @[^@]+\.(top|faith|science|ru|cn)$, adjusting the TLDs to match your requirements.

3
Choose an action

Under Do the following, select Block the message and choose whether to reject it with an explanation or delete it without notifying anyone.

4
Test and enable the rule

Choose a test mode in the rule settings and save the rule. Review the results for affected senders, then edit the rule and enable enforcement when you are satisfied.

Block selected TLDs with an Exchange Online mail flow rule
Check the sender address setting: In the rule settings, review whether the rule matches the message header, envelope, or both. Test with representative messages because the sender address used can affect which mail is matched.
Free Microsoft Office alternative

Work with Office files using WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move existing documents. It does not manage Exchange Online mail flow or spam policies.

Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse familiar document, spreadsheet, and presentation toolsMove existing Office files into a lightweight workspaceContinue managing Exchange Online spam rules separately
microsoft office alternative - wps office

Frequently Asked Questions

Can I block every domain under a TLD using the blocked domains list?

The blocked domains list is intended for specific domains. To target a defined set of TLDs, create a sender-address pattern under Exchange admin center > Mail flow > Rules.

Will blocking a TLD affect legitimate email?

Yes. A rule targeting a TLD can match legitimate senders as well as spammers. Use a test mode first and review the results before enabling enforcement.

Where can I block a specific spam domain?

In the Microsoft Defender portal, go to Email & collaboration > Policies & rules > Threat policies > Anti-spam. Edit the applicable inbound policy and add the domain to its blocked domains list.

Can WPS Office configure Exchange Online spam filtering?

No. Configure mail flow rules in the Exchange admin center and anti-spam policies in the Microsoft Defender portal. WPS Office is an alternative for working with Office files.