How to Require an AND Condition in an Exchange Mail Flow Rule
Question details
The user needs to configure an Exchange mail flow rule that triggers only when two separate text phrases are both present in the email.

- Product
- Microsoft Exchange
- Device & OS
- not provided
- Scenario
- Setting up administrative email routing and mail flow rules based on specific text conditions.
- Observed behavior
- Exchange admin center treats multiple words entered in a single mail flow condition as an OR relationship, rather than requiring both words to be present.
Ensure you have the necessary Exchange Administrator permissions to modify mail flow rules. It is highly recommended to test your logic using the 'Test without Policy Tips' mode before enforcing the rule globally.
Use Separate Applicable Text Conditions
Configure the required phrases across distinct, separate conditions (like subject and body matches) to effectively create an AND logic relationship.
Exchange limits the ability to add the exact same condition twice to form an AND relationship. To bypass this, you must use different condition fields that target the same message properties.
Log in to the Exchange Admin Center, navigate to the 'Mail flow' section on the left-hand menu, and select 'Rules'.
Click the '+ Add a rule' button to create a new transport rule, or select an existing rule and click the Edit (pencil) icon.
Under the 'Apply this rule if' dropdown, select 'The subject or body includes' and enter your first required text phrase.
Click the 'Add condition' button. For the new condition, select 'The subject or body matches these text patterns' and enter your second required text phrase.
Save your mail flow rule configurations. Send test emails containing both phrases, only one phrase, and neither phrase to ensure the rule triggers exactly as intended.

Enhance Your Daily Workflow with WPS Office
While managing Exchange server rules requires specialized administrative tools, your everyday document tasks don't have to be complicated. WPS Office provides a free, lightweight, and powerful alternative to Microsoft Office, offering seamless compatibility for all your business documentation needs.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installation file and follow the quick, on-screen setup instructions.
- 3. Open Your Documents: Launch WPS Office and instantly open your existing .docx, .xlsx, or .pptx files without formatting loss.

Frequently Asked Questions
Why does Exchange treat multiple phrases in a condition as an OR statement?
By design, when you add multiple words or phrases to a single text condition array in the Exchange Admin Center, the system evaluates them using OR logic. If any one of those phrases is detected, the condition is met.
Can I use Regular Expressions to force an AND condition in mail flow rules?
Yes, Exchange supports regular expressions via the 'matches these text patterns' condition. While advanced RegEx can simulate an AND relationship using lookaheads, it is often complex to write and can negatively impact server performance, making separate conditions the preferred method.
How do I safely test my new mail flow rule before applying it?
When creating the rule, you can select the 'Test with Policy Tips' or 'Test without Policy Tips' mode. This evaluates the rule's conditions against live mail flow and logs the results in message tracking without actually applying any actions like blocking or redirecting the email.




