Routing Rules
Routing rules are configurations that determine how email messages are directed within or beyond an organization's email infrastructure. These rules can be set up to manage incoming, outgoing, or both incoming AND outgoing messages based on specific conditions. Think of Routing Rules as "Content Filters for the Spool" -- they act similarly to domain or user content filters though these only act on incoming messages for a user or domain. Routing rules work on anything coming into, or leaving, the spool.
Routing rules can be used for a number of different scenarios. For example, administrators can configure rules to route bounced messages to a specific mailbox. Or, messages that have a specific attachment, such as "company_secrets.pdf", can have that attachment stripped prior to the message actually being sent. The key is that routing rules are extremely flexible and be used for a number of different scenarios.
Important Notes
- Routing Rules are extremely powerful, and they need to be used with care to avoid potential drawbacks such as missing emails, etc.
- All routing rules are run, from top to bottom. Unlike Content Filters, which stop processing once a content filter is fired, all routing rules are processed.
- Routing rules are processed on messages in the spool -- incoming, outgoing, or both, depending on how the rule is set up. However, if archiving is enabled, messages WILL BE archived prior to any routing rules being processed.
- If a Condition is left blank for any routing rule, all conditions are considered "True" and the Actions configured will run.
- For extension matching, SmarterMail uses an "exact match" formula. Therefore, "doc" and "docx" are treated 2 completely separate extensions.
- Some Actions will stop any additional Actions from being performed. For example, a "Quarantine Message" action, once performed, will not fire any other Action that occurs after the quarantine. As such, these Actions, when used, should be on their own or, at the very least, the last Action added to a Routing Rule.
Create / Edit Routing Rules
Initially, the Routing Rules area will be empty. However, if an existing rule is displayed, it can be clicked on and edited as needed.To create a new Routing Rule, click the New button. You'll see three (3) tabs displayed: Options, Conditions, and Actions. The Options tab will be highlighted.
The Options tab is where you set up some initial information about the Routing Rule. The Conditions tab is where you set up the conditions that will determine if the Routing Rule should be applied. The Actions tab is where you set up the actions that will be taken if the Conditions are met.
Options
The Options tab holds the Options card. Here you will set the following:
- Name - The friendly name of the rule. Ideally, this will be something specific to the rule being created as this information is logged by SmarterMail when it fires. Using a generic, or non-descriptive name can make it difficult to know, when reviewing logs, what the rule is for and what it does.
- Match Type - This is where you set how the rule applies the Conditions that are set. Whether "Any" condition is met, or whether "All" conditions are met.
- Messages to Scan - This is where whether the rule is for inbound messages, outbound messages, or both.
- Enabled - Whether the specific rule is enabled or disabled.
- Enable wildcards in search strings ( * and ? ) - The * and ? wildcards are used in search strings to represent unknown characters or sequences. Asterisks (*) are used for zero or more characters. For example, when used with "bird*", "bird", "birds", "birding", etc. would be returned. Question marks (?) are used for single, unknown characters. For example, "te?t" would return "text" and "test". Generally, neither should be used as the first character in order to prevent performance issues. For example, "*ing" could infer an extremely large dataset as anything preceded by "ing" would be found/used/indexed.
- Include System Messages and Mailing Lists when evaluating conditions - By default, only messages sent from, or to, specific domains or users are evaluated for Routing Rules. If all messages are to be evaluated, this setting should be enabled.
Once the Options are set, the routing rule can be saved and Conditions and Actions added to the rule.
Conditions
When going to the Conditions tab, click on New to specify the criteria that triggers the rule's action(s). For each condition selected, you will be able to add specifications and enter any necessary details, as required. For example, if you choose to filter on 'From Address', you can enter one or multiple email addresses. If you choose to filter on 'Contains specific words or phrases', you can enter the specific text and choose to look for that text in an email's subject, message body, header, etc.
On many conditions, you also have the ability to reverse the logic of the criteria item by changing the Comparison selection. For example, imagine you only want to accept email from specific domains. You would choose the 'From specific domains' condition and set the Comparison field to 'Does Not Match". Any messages sent from domains that do not match what you've entered in the text box can be deleted.
Actions
Once Conditions are set, it's possible to add actions. (This is possible before any Conditions are set as well.) When going to the Actions tab, click on New to specify what happens when one or more Conditions are met. As with Conditions, several Actions can run based on the criteria selected for the specific Condition(s) added. It's also worth remembering, as mentioned above, that some Actions will stop any additional Actions from being performed. In these cases, that is noted on the Actions modal. In addition, Actions can contain variables for things like notifications, sending emails, etc.
Action Variables
All Actions that have the ability to use variables have the same variables available to them. These are:
- Day of Week - #dayofweek#
- Time of Day - #timeofday#
- Date - #date#
- Spool ID - #spoolid#
- Message File Path - #messagefilepath#
- Return Path - #returnpath#
- Originating IP Address - #fromipaddress#
- Recipients - #recipients#
- Subject - #subject#
- From Address - #fromaddress#