In Office 365 solution, you have to enable the Exchange Online Protection. You have to use Global Admin or an Exchange Company Administrator account.
The Directory Based Edge Blocking (DBEB) feature from Office 365 enables users to reject messages for nonexistent recipients.
For enabling DBEB, follow these steps:
Here is the Microsoft documentation related to this chapter: https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/use-directory-based-edge-blocking
Now, when you configured everything, you have to change your MX records in order to point to our Enterprise Mail Filtering servers.
Do not forget to adapt your SPF entry in your DNS to include the Microsoft O365 entries according to their documentation, but also to add the IPs of our filtering servers too.
Info: a warning on the Office 365 dashboard will inform you that your MX are not pointed to Microsoft. You can ignore it.