Problem
Exclude specific users from receiving emails sent to a group with all users in the organization.
Environment
- Admin console
Solution
- In the Admin Console.
- Navigate to Apps > Google Workspace > Gmail > Compliance.
- Go to the Content Compliance setting and Add a rule.
- Select the options Inbound and Internal - receiving to cover all messages incoming to the group.
- In the section Add expressions that describe the content you want to search for in each message choose:
- If ALL of the following match the message.
- Click the Add button beside Expressions.
- Configure the expression as follows:
- Change Simple content match to Advanced content match.
- In the Location field, choose Full headers.
- In the Match type field, choose Contains text.
- In the Content field enter X-BeenThere: group@domain.com replacing the address with the address of the group in question.
- Click the Save button.
- Click the Add button one more time to add another expression.
- Configure the expression as follows:
- Choose Advanced content match.
- In the Location field, choose Full headers.
- For Match type select Contains text.
- In the Content field, enter the email address of the user you want to exclude from the All users in the organisation group.
- Click the Save button.
- Finally, after adding these expressions, in the third section labeled If the above expressions match, do the following change the field Modify message to Reject message or Quarantine in case you prefer to not generate an NDR for the sender.
- Click the Save button
Cause
These kinds of groups automatically add all domain users into these groups with the special user All users in the organization. However, not always the delivery of a message to this group is wanted for exactly All users and the best option to avoid the delivery is by setting up a Content Compliance rule.