How to Create and Apply Transport Rules in Exchange Online
You can make and use Transport Rules in Exchange Online with the Exchange Admin Center. These rules help you manage how emails move in your group. They also help you follow rules and do some jobs automatically. Transport Rules let you set rules for emails in your mail system. You can choose what happens to messages that meet certain conditions. Using these tools makes your email safer and helps things work better.
Key Takeaways
Transport Rules help manage and protect email in your group. They set rules for what happens to messages. You need special permission and must use the Exchange Admin Center. This lets you make and change these rules the right way. Make rules by picking clear conditions, actions, and exceptions. This helps emails get handled safely and automatically. Test your rules well before you use them. This helps stop mistakes and makes sure they work right. Check your rules often. Change their order or update them as needed. This keeps your email safe and working well.
Transport Rules Overview
What Are Transport Rules
Transport Rules help you manage how email moves in your group. You make these rules to check emails before they go to mailboxes. You choose what happens to emails by looking at details, like who sent them or what words are inside. These rules work while emails are moving, not after they arrive. You can use the Exchange Admin Center or PowerShell to set up and change these rules.
Tip: Transport Rules work like big filters for your whole group, not just one mailbox. They give you more power than normal inbox rules.
Common Uses
You can use Transport Rules for many jobs in your group. Here are some ways you might use them:
1. Send emails with sensitive data to a Data Loss Prevention (DLP) service. 2. Put messages in quarantine if they have private information. 3. Send emails to an admin for approval if they have certain things inside. 4. Forward messages to a manager when needed. 5. Encrypt emails by rule when it is needed. 6. Stop emails that break company rules.
These uses help keep your group safe and help you follow rules.
Key Features
Transport Rules have some important features that make them good for managing email:
You can set rules to work in a certain order. If an email matches a rule, you can stop other rules from working. This helps you handle tricky email needs.
Prerequisites
Permissions Needed
Before you create or manage transport rules, you need the right permissions in Exchange Online. Only certain role groups can set up and change these rules. If you do not have the correct role, you will not see the options you need.
Here is a table that shows which role groups let you create and manage transport rules:
You can join one of these role groups to get the needed permissions:
Records Management role group
Note: If you are not sure about your role, ask your Exchange Online admin. You need to be in one of these groups to work with transport rules.
Accessing Exchange Admin Center
You manage transport rules in the Exchange Admin Center (EAC). The EAC is a web-based tool that helps you control mail flow and other settings.
Follow these steps to access the EAC and find the transport rules:
Go to the Exchange Admin Center at
https://admin.exchange.microsoft.com
.
In the EAC, select the Mail flow section.
Click on Rules to see all transport (mail flow) rules.
From the Rules page, you can create, enable, disable, or delete transport rules.
For quick access, you can use
https://admin.exchange.microsoft.com/#/transportrules
to go straight to the Rules page.
You now have the right permissions and know how to reach the place where you can set up transport rules. This makes it easy to start managing your mail flow in Exchange Online.
Create Transport Rules
Setting up Transport Rules in Exchange Online helps you control how emails move in your organization. You can follow these steps to create a new rule and make sure it works the way you want.
Start a New Rule
You can start a new rule in the Exchange Admin Center. Here is how you do it:
Go to Mail flow in the left menu.
Click Rules.
Select + Add a rule and choose Create a new rule.
Give your rule a clear name so you remember what it does.
You now have a blank rule ready for setup.
Set Conditions and Actions
Conditions decide when your rule will work. Actions tell Exchange what to do when the rule matches an email. You can set these up in the rule editor.
In the Apply this rule if section, pick your conditions. For example, you might choose emails from a certain sender or with specific words in the subject.
You can add more than one condition to make your rule more exact.
In the Do the following section, pick what happens to matching emails. Common actions include forwarding, redirecting, or sending messages to quarantine.
Here is a table with some actions you can use:
Tip: You can check audit logs to see who created or changed rules and what conditions or actions they used.
Add Exceptions
Sometimes you want your rule to skip certain emails. You can add exceptions in the Except if section.
Exceptions use OR logic. If any exception matches, the rule does not apply to that email.
You can add exceptions for senders, groups, addresses, or even words in the message.
Here are some common exceptions:
If you need more complex exceptions, you can create more than one rule with different exceptions.
Note: You can add exceptions to avoid blocking important emails or to allow trusted senders.
Configure Settings
You can change settings to control how your rule works.
Choose how to match the sender address. You can pick Header or Header or envelope. This helps the rule catch auto-forwarded messages.
Set the rule to stop processing more rules if you want no other rules to run after this one.
Decide if the rule should be enabled right away or stay off until you are ready.
Place your rule in the right order. Rules at the top run first. If a rule stops processing, later rules do not run.
Tip: Rule order matters. If two rules could match the same email, the one higher in the list runs first. Use the "stop processing more rules" option to control this.
Save and Enable
After you finish setting up your rule:
Review all your settings.
Click Finish to save the rule.
On the Rules page, move your rule up or down to set its priority.
Make sure the rule is enabled. If not, toggle it on.
Transport Rules do not have their own size limits, but message size limits set by your organization or mailbox may stop large emails before rules run. There are no special delays for processing rules. Exchange checks rules in order, so the setup you choose affects how emails flow.
Note: Server-level Transport Rules work for your whole organization. Outlook inbox rules only work for one mailbox. Server rules have more power but also more limits, like how many recipients you can add or how much text you can scan in attachments.
Here is a table to show the main differences:
By following these steps, you can create and apply Transport Rules that help you manage mail flow, keep your organization safe, and meet your business needs.
Example Rule
Block or Redirect Email
You can use transport rules to block or redirect emails in Exchange Online. For example, you might want to stop auto-forwarded emails from leaving your organization. This helps protect confidential information. You can set up a rule that looks for messages marked as 'Auto-forward.' When the rule finds one, it rejects the message and sends a notice to the sender. This keeps your data safe and informs users why their message did not go through.
Another common use is redirecting emails sent to an old address. Sometimes, people keep sending messages to a vendor’s outdated email because Outlook remembers it. You can create a rule that catches any email sent to the old address. The rule then redirects the message to the new address. This makes sure important messages reach the right person. If you prefer, you can block the email instead, but this may confuse users.
Tip: Give your rule a clear name, like “Block Auto-Forward to External” or “Redirect Old Vendor Email,” so you can find it later.
Test the Rule
Testing your new transport rule is important before you use it for everyone. You want to make sure it works as planned and does not cause problems.
Set the rule to 'Test without Policy Tips' mode first. This lets you see what would happen without affecting real emails.
Use the
Test-Message
PowerShell cmdlet to check if the rule works as expected.Try the rule with a test account or a small group. This limits risk and helps you spot issues early.
Check the rule’s priority and use a unique name to avoid confusion.
Send test emails and look at the message headers. Make sure the rule applies correctly.
After testing, remove any test-only settings and apply the rule to your whole group.
Note: Always test how your rule works with other policies, like Data Loss Prevention, to avoid surprises.
Manage and Optimize
Edit and Reorder
You can keep your mail flow smooth by editing and reordering your transport rules. Start by signing in to the Exchange Admin Center. Go to Mail flow and select Rules. Pick the rule you want to change and click the edit icon. You can add or remove conditions, such as limiting the rule to a group or expanding it to more users. Save your changes when you finish.
To reorder rules, drag them up or down in the list. The order matters because Exchange checks rules from top to bottom. If a rule stops processing, later rules do not run. You can also add or remove users from groups in the Microsoft 365 admin center. This helps you control who the rules affect.
Tip: Review your rules often. Update them when your team changes or when you add new policies.
Monitor and Troubleshoot
You need to check if your rules work as planned. Use message trace logs to see which rules matched each email. These logs show the rule ID, action, and when the rule ran. You can spot problems, like a rule not working or blocking too many emails.
Try the Test-Message cmdlet for deeper checks. This tool shows why a rule matched or did not match. It helps you see if group membership or exceptions caused issues. Always check the rule’s priority and make sure it is enabled before testing.
Message trace logs help you track rule actions.
Test-Message cmdlet gives detailed reports for troubleshooting.
Review logs to find and fix problems quickly.
PowerShell Management
PowerShell gives you more control over transport rules. You can connect to Exchange Online with the Connect-ExchangeOnline cmdlet. Use Get-TransportRule to list all rules or see details for one rule. Set-TransportRule lets you change rule settings, like conditions or actions.
PowerShell helps you automate tasks, such as updating many rules at once. You can script changes, making it faster to manage large environments. Some advanced features, like bulk edits or complex conditions, work best in PowerShell. This tool also works even if the Exchange Admin Center is limited or offline.
PowerShell is a strong choice for advanced rule management and automation.
To control how emails move in Exchange Online, you make Transport Rules. First, sign in to the Exchange Admin Center. Next, set up conditions, actions, and exceptions for your rule. Then, turn on the rule so it works. You should test and check your rules often. This helps stop problems with email delivery or security.
Write down your rules and look at them often. This helps you not make mistakes.
If you want more control, use both the Exchange Admin Center and PowerShell. Using both tools keeps your email safe and working well.
FAQ
How do you know if a transport rule works?
You can send a test email that matches your rule. Check the message trace in the Exchange Admin Center. Look for your rule’s action in the log. This helps you see if the rule works as planned.
Can you use transport rules to block spam?
You can use transport rules to block emails from certain senders or with specific words. For better spam protection, use Exchange Online Protection. Transport rules help with custom needs, not full spam filtering.
What happens if two rules match the same email?
Exchange checks rules in order from top to bottom. The first rule that matches runs its actions. If you set “stop processing more rules,” later rules do not run for that email.
Can you copy a transport rule to another tenant?
You cannot copy rules directly in the Exchange Admin Center. You can export rules with PowerShell using Get-TransportRule
and import them in another tenant. Always review and test rules after importing.
How many transport rules can you create?
You can create up to 300 transport rules in Exchange Online. Each rule has a size limit. If you reach the limit, review and remove old or unused rules to keep your mail flow working well.