There are multiple methods to achieve this goal.
Option 1: Create a mail flow rule
- Login Microsoft 365 admin center
- Go to Exchange online admin center.
- Go to ->mail flow.

3. Rules.

4. Select Restrict messages by sender or recipient.

5. In Set rule conditions, Apply this rule if: The sender is…-> a member of…-> select distribution group address. Do the following: Block the message and Delete the message without notifying anyone. Except if: the sender is a member of…:

6. Click on Next in Set rule settings.

7. Click Finish on Review and finish.

Option 2: Modify “delivery management” setting:
1. Go to Exchange admin center->recipients->groups

2. Double-click the Distribution group to edit it.

2. Select “delivery management”->and add specific senders as well as groups that are allowed to send message to the group, by which way messages sent by anyone else will be blocked.
