How to Configure Mail Flow Rules in Exchange Online

Author by Martin Ilesanmi andTemitope Victoria
Exchange Online, Microsoft 365

 How to Configure Mail Flow Rules In Exchange Online

Mail Flow Rules also called transport rules recognize and respond to messages passing through Exchange Online.

Similar to the Inbox rules found in Outlook and Outlook on the web, mail flow rules are also available in Outlook. One key distinction is that, unlike mailbox-based rules, mail flow rules intervene with messages while they are in motion. Mail flow rules are also called Transport Rules.

What Are Mail Flow Rules?

Mail flow rules allow you to manage how emails flow through your organization. These rules can automatically take action on messages based on specific conditions.

Requirements to Configure Mail Flow Rules

It is required for a user to have access to the Exchange admin or Exchange Online PowerShell to configure mail flow rules. Administrators like Global admin and Exchange admin can configure mail flow rules. The permissions needed are important for security purposes. 

Creating Mail Flow Rules

There are two methods of creating a mail flow rule.

  1. Exchange Admin Center (EAC)
  2. Exchange Online PowerShell

Creating a mail flow rule requires rule conditions, exceptions, actions and settings.

Mail flow Rule Conditions

Conditions specify messages to include. 

  1. You can configure a rule to apply only to messages containing specific words.
  2. Apply the rule to messages sent by specific users.
  3. Target all messages except those sent by members of a specific distribution group.
  4. Most conditions have one property that requires one or more values. 

Case Study for Rule Conditions

You can create a rule to prevent organisation users from sending emails to Gmail or Hotmail. Your goal with the rule is to prevent any sensitive information or details from being sent to their personal Gmail or any other Gmail.  

The condition will state that the rule should be applied that the email should be blocked if any recipient’s address includes Gmail or Hotmail. 

 

Rule Exceptions

Exceptions specify messages to exclude. They use the same settings and syntax as conditions.

For every condition, there’s a corresponding exception. The only difference is that conditions include messages, while exceptions exclude them.

  1. Exceptions help fine-tune rule behaviour. 
  2. Exclude specific senders from a rule that applies to all other messages.
  3. Avoid applying a disclaimer to messages with certain characteristics.

Case Study for Rule Exceptions

The Gmail rule can be excluded from some users within the organization. Let’s say the CEO or IT Admin need to be able to send emails to Gmail accounts, you will apply an exception. The exception will state “Except if the sender is [email protected] or if the sender is a member of this group [email protected]

When creating rules in the Exchange Admin Center (EAC), the displayed value in the “Apply this rule if” or “Except if” field may differ from the initial selection due to shortening.

PowerShell allows you to create rules without specifying any condition parameters by using [Apply to all messages].

 

Rule Actions

Now, let’s briefly touch on rule actions. These define what happens when a mail flow rule matches the specified conditions.

Rule actions include tasks.

  1. Adding disclaimers to messages
  2. Redirecting messages to specific recipients
  3. Moving messages to folders
  4. Setting flags or categories
  5. Forwarding messages
  6. Deleting messages

Each Rule object has an Actions property representing the actions for that rule. It also has Conditions and Exceptions properties for defining the rule’s criteria.

These rules play a crucial role in managing email flow and ensuring compliance within organizations.

Rule Settings

Setting rules requires priority and enforcing the rules. Rule Priority is the importance and order of rules to ensure they are executed. Rule priority is important because. It determines the order in which these rules are applied. Higher priority means a rule is processed earlier in the sequence.

How to Set Rule Priority
1. In the Exchange Admin Center (EAC). Go to Mail flow > Rules.
2. The rules are listed in the order they’re processed. The rule at the top has Priority value 0 and is processed first.
To change priority:
1. Click on the rule you want to adjust.
2. Use the Move Up or Move Down arrows to change its position.

Using the Exchange Admin Center (EAC)

mail flow rule

  1. Navigate to the Mail flow – Rules section in the new EAC.
  2. Choose from templates or create a new rule from scratch.
  3. Specify conditions, exceptions, and actions for the rule.

set rule conditions exchange online

 

EXAMPLE- CREATE A MAIL FLOW RULE 

 Create a mail flow rule to restrict users from sending emails to Gmail or Hotmail. The concept is to ask the admin for approval to send the email. However, the IT admin group and CEO should be able to send emails to Gmail or Hotmail.

The concept of creating the rule will determine the options you choose and the words you add in the checkbox. 

rule conditions mail flow rule in exchange online

  1. Navigate to Mail flow > Rules > Add a Rule > Create a new rule.
  2. Name the rule.
  3. Condition: Apply this rule if “any recipient address includes any of these words Gmail or Hotmail”. Selecting the options gives you a box to add the words.
  4. Actions: “Do the following – reject the message and include an explanation, reach out to admin for approval”. Selecting the option opens a box to add the message for the users.
  5. Exceptions: “Except of the sender is this person – Pradeep”. Choosing the option “is this person” allows you to choose the CEO’s email address. To add more exceptions, click on +. To add the IT admin- “Or the sender is a member of this group- ITAdmin”.
  6. Click on Next.rule settings mail flow
  7.  Rule Settings – Enforcing the rule mode will enforce it across organisation users.
  8. Rule Settings – Activate the rule within a specified date if you want the rule to run for some time. 
  9. Rule Settings – Test. You can test the rules as an admin before it is enforced for all the users to ensure it is working.
  10. Click on Next
  11. Review and Submit the rule.
  12. Enable the rule and it will take a few hours to take effect for all users.

For more details, check out the official documentation on managing mail flow rules in Exchange Online

Viewing and Modifying Rules

To view rules in the Exchange Admin Center, navigate to mail flow – rules. Edit the rule. Make the changes you want to make. In modifying the rules, there are conditions, exceptions and actions to take. 

Testing and Monitoring Rules

Always test rules to ensure they work for users across the organizations. It is essential to thoroughly test each rule.

 

Using PowerShell

Mail flow rules can be created with PowerShell. Connect to Exchange Online to create the rule. 

To create a sample rule in PowerShell:

New-TransportRule -Name “Mark messages from the Internet to Sales DG” -FromScope NotInOrganization -SentTo “Sales Department” -PrependSubject “External message to Sales DG:”

Conclusion

Customizing mail flow rules is important for security, privacy and compliance for organizations. 

Evolve Connect is offering an extensive bootcamp on Microsoft 365 Training including Microsoft 365 and Exchange. Gain knowledge and industry experience. Register now!

Related Posts

Microsoft CoPilot Wave 2, What's New
Microsoft Copilot Wave 2: What’s New
5 ways seeing Ai helps blind people
5 Ways Seeing AI Helps Blind People
Introducing Seeing AI, AI tool for visually impaired people evolve connect
Introducing Seeing AI: The AI Tool for the Visually Impaired 
Leveraging CoPilot for Sales Forecast Evolve Connect
Leveraging CoPilot for Sales Forecast
Microsoft teams and copilot, improve sales
Microsoft Teams and CoPilot: Improve Sales
How to personalize customer interactions with copilot
How to Personalize Customer Interactions with CoPilot
Simplifying Legal Document preparation for copilot
Simplifying Legal Document Preparation with CoPilot
Microsoft Designer Homepage with pointers
CoPilot for  Graphic Designers and Content Creators
Improve users experience with copilot
Improving User Experience with CoPilot
Improving customers support with CoPilot
Improving Customer Support with CoPilot.
Shopping Basket

Volunteer for 
Tech-In-The-Slum Initiative

Individual
Organisation
[forminator_form id="1321"]
[forminator_form id="1322"]