User Tools

Site Tools


how_to:smtp_rule_example_-_restrict_who_can_send_to_a_local_email_address

SMTP Rule Example - restrict who can send to a local email address

If you have a local email address (a user, group or distribution list) and you want to restrict which email addresses can send messages to this address, you can use SMTP rules.

There are a few ways you can configure the SMTP rules for this scenario.

Because SMTP rules are calculated as either 'ALL conditions' or 'ANY conditions' (and you can't specify 'condition A AND (condition B OR condition C)' then it is complicated a bit.

You can either create two rules: 'condition A AND condition B' and 'condition A AND condition C' or use De Morgan's law to change the condition to require ALL conditions in one rule.

If you want everyone except for a few users to be able to send to this address

For this example, say you have a distribution list called directors and you want everyone to be able to send to this list except for usera@companya.com and userb@companyb.com

Simple way, using multiple rules

Create two SMTP rules as below:

If you want to block more senders, just add more rules like this. So, for one or two addresses, this is fine, but if you have many addresses, it will soon become unwieldy

Short way, using two rules

You need one rule to allow all other senders to send to the list, then second rule to block anyone not matched by the first rule.

Create two SMTP rules as below:

Here we have used De Morgan's law to convert the rule to an ACCEPT rule which will accept messages to the list as long as it is not one of the prohibited senders.

This rule must come after the above rule, and will block messages to the list, if they were not accepted by the previous rule - so this will block messages to the list by the prohibited senders.

If you want to add more prohibited senders, just add them to the first rule, as in the examples there.

If you only want a few users to be able to send to this address

For this example, say you have a distribution list called directors and you want no one to be able to send to this list except for usera@companya.com and userb@companyb.com

Simple way, using multiple rules

Create three SMTP rules as below:

The last rule must come after the others to block all other senders from sending to the list.

If you want to allow more senders, just add more rules like the first one. So, for one or two addresses, this is fine, but if you have many addresses, it will soon become unwieldy

Short way, using two rules

You need one rule to block all other senders from sending to the list, then second rule to allow anyone not matched by the first rule.

Create two SMTP rules as below:

Here we have used De Morgan's law to convert the rule to a REJECT rule which will block messages to the list as long as it is not one of the allowed senders.

This rule must come after the above rule, and will allow messages to the list, if they were not rejected by the previous rule - so this will allow messages to the list by the allowed senders.

If you want to add more allowed senders, just add them to the first rule, as in the examples there.

how_to/smtp_rule_example_-_restrict_who_can_send_to_a_local_email_address.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1