Configure mail flow rules

Completed

Mail flow rules provide you with an almost limitless ability to control messaging in your Exchange Server organization. Messaging administrators must carefully plan their Mail flow rules to ensure they behave as intended. Failure to do so could result in accidentally deleted messages, or messages delivered to unintended recipients.

Organizations should consider the following recommendations when planning Mail flow rules:

  • Plan conditions and exceptions carefully. Mail flow rule conditions and exceptions define which messages are affected by the Mail flow rule. If you implement the rules incorrectly, you may unintentionally modify or delete messages.
  • Plan for Mail flow rule priority and order. In many cases, you must apply several Mail flow rules in your organization. If these Mail flow rules have conditions that can overlap in some cases, it’s important that you order them properly.
  • Use regular expressions to check message contents. Use regular expressions to simplify the list of terms when you're including a text string in a condition. You can use one regular expression, rather than a list of variations on the same word. For example, when searching for a phone-number pattern, you can use the expression “\d\d\d(-|.)\d\d\d\d”, which denotes a pattern of three digits, then a dot or dash, and then four digits.
  • Test application of Mail flow rules. Test new Mail flow rules to ensure they behave as intended. Testing is important to avoid situations where a new Mail flow rule conflicts with existing Mail flow rules.
  • Plan for Mail flow rule limitations on encrypted and digitally signed messages. RMS integration with Exchange Server enables you to implement Mail flow rules and messaging policies when you’re using RMS Information Rights Management encryption to protect messages. Encryption through other mechanisms may prevent you from applying Mail flow rules or records management. For example, Exchange may be unable to scan encrypted messages for the text string specified in a Mail flow rule.

Mail flow rules can be configured through the Exchange Admin Center (EAC) and the Exchange Management Shell (EMS) by using the New-TransportRule and Set-TransportRule cmdlets.

Additional reading. For more information, see Best practices for configuring mail flow rules in Exchange Online.