Option 1: Anti-Spam Policy
Blocking a domain here will cause those messages to go into quarantine.
Go to Anti-spam policies page
https://security.microsoft.com/antispam
Click on Anti-spam inbound policy (Default)
Scroll to the bottom and click on Edit allowed and blocked senders and domains

Click on Block domains

Click Add domains

Here you can add domains
Option 2: Mail Flow Rule
Adding domains here will cause them to hard bounce back to the sender, or be silently discarded.
Go to Mail Flow Rules page
https://admin.exchange.microsoft.com/#/transportrules
Add a rule
Select The sender from the dropdown, and Domain is from the second dropdown.
Then add the list of domains and click save.
Under Do the following, select Block the message and then select either of:
- Reject the message with the enhanced status code of: If you select this, put 5.7.1 as the error code. The sender will get a bounce.
- Delete the message without notifying anyone: The sender will not get a bounce.
Click next

On the next page, Match sender address in message header or envelope.
Click next and then finish.
You also need to enable the rule.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article