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.
Conditions are arranged in "Condition Types." These are, essentially, the primary categories of conditions, with each Condition Type having a subset of Fields that are used for the condition. Some Condition Types also have a Comparison component. These are generally "true or false" type values, like "contains" or "does not contain". A "false" or "does not contain" comparison essentially reverses the logic of the criteria being entered. In addition, some Condition Fields have their own subset of criteria. For example, a Spam Level Field allows a specific Spam Level to be selected.
Condition Types, and their respective Fields, are listed below. (This list is subject to change and modification.)
From Address
- From Address
- From Domain
To Address
- To Address
- To Domain
Contains Specific Words or Phrases
- Subject
- Body
- Subject or Body
- From Address
- To Address
- Email Header
- Anywhere In Message
Message Properties
- Message Over Size
- Message Under Size
- Message Priority
- Is Signed or Encrypted
Delivery
- Sender Authenticated
- Is Being Forwarded
- Spam Score
- Spam Level
- Message Type
- Is Whitelisted
- Time of Day
- Day of Week
- External Sender
Attachments
- Has Any Attachment
- Specific Extension
- Specific File Name
- Over Specified Size
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 (noted, below, with an asterisk) 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. All available Actions are listed below. (This list is subject to change and modification.)
- Delete Message
- Send to Gateway
- Quarantine Message*
- Add Header
- Subject Prefix
- Bounce Message
- Strip Attachments
- Stop Processing Rules*
- Add Recipient to Message
- Send Copy to Recipients
- Show a Notification
- Send Email
- Command Line Action
- Send Webhook
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#