Scripted filters are useful to process messages in a particular way that is not available in other settings. They can be configured at the global level, or if you have an Enterprise version license, you can also create these at the postoffice level. Postoffice level filters only act on inbound messages, whereas global filters act on all messages passing through the server. Mailbox filters do not support scripted filters.
Both mailbox and postoffice filters only act on emails being delivered into a mailbox. They do not work for messages being sent outbound. Those filters do not work by who is sending the email, but get executed when they are being received. So you can use the postoffice and mailbox filters to block inbound email to a mailbox, but you cannot use them to restrict outbound emails for a user. To do that you need to use a global filter.
The following scripted filter allows a mailbox to send and receive only to addresses in their own domain. You may wish to alter headers, redirect or delete the messages. It is recommended to initially just create an action to alter the subject line or redirect the message so you are able to test before implementing an action such as a delete.
To help only , this criteria script will run the actions if the sender or recipient is not in the example.com domain:
If CriteriaMet([ME_TOorCC],"*email@example.com*") and not
if CriteriaMet([ME_FROM],"*firstname.lastname@example.org*") and not CriteriaMet([ME_TOorCC],"*@example.com*") then
|Class:||HOWTO: Product Instructions|
|Revised:||Wednesday, June 10, 2020|