We recently announced that we've started work on a Kerio Server Migration to Office 365. One of our clients gave us test data from a few departed/terminated users to test our code. It's easy to test in our Exchange on-prem sandbox to ensure no "external" email gets sent to their users -- we unplug the Ethernet connection to the Router. It's a little more complicated in Office 365, but not all that difficult. Here are the steps:
In the Exchange Admin Center, under Mail Flow, Rules, click the "+" sign to create a new rule.
- Name the rule. We called it "Block Mail sent to External Email"
- Select the option from Apply this rule pulldown: "The Recipient is Located...."
- Select the option "Outside The Organization" from the subsequent pulldown that the recipient is located
- Select "Reject the message with the explanation" from the pulldown "Do the Following..."
- Enter a message (optional): We entered "The message was not sent. The Recipient is located outside the company."
- We chose to Enforce the rule, and finally
- Saved it
Here is a screen shot: