Let's say you have a group called "Everyone". But you only want internal people to be able to email the group and possibly another company.
- -open the EXCHANGE MANAGEMENT SHELL.
- -type: set-TransportRule -Name 'Block Email to GROUPNAME Except from ACCEPTED Domains' -AnyOfToHeader ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ' -IsValid true -Actions {RejectMessage} -ExceptIfSenderDomainIs {validDomain1.com, validDomain2.com}
There are some other parameters in there too but that should do it.
If you want to do it visually:
- -open the EAC.
- -click MAIL-FLOW (on the left-hand side).
- -click NEW.
- -type: A-NAME-FOR-THE-RULE
- -click THE MESSAGE > THE TO BOX CONTAINS.
- -search for GROUP-NAME.
- -click ADD > OK.
- -BLOCK THE MESSAGE > REJECT THE MESSAGE AND INCLUDE EXPLANATION.
- -type UNKNOWN USER or some other explanation.
- -click MORE OPTIONS.
- -click ADD EXCEPTION.
- -click THE SENDER > DOMAIN IS
- -type: domain1.com
- -click +
- -and so on.
- -click OK > SAVE (at the bottom).