If you have multiple domains in your Exchange Server 2007/2010/2013/2016/2019 and need some or all of them to route through a different Send Connector, you will need to enable SBR (Sender Based Routing) in your Exchange Server.
Sender Based Routing is not supported in Exchange 2007/2010/2013/2016/2019 natively, so a custom SBR Transport agent must be configured.
This tutorial gives you a quick overview of how to set up and enable
"Sender Based Routing or Transport Rule Based Routing"
in Exchange Server 2007/2010/2013/2016/2019.
Exchange Server doesn’t support “Sender Based Routing” natively, but you can use an Exchange Server plugin to enable this function.
How it works:
"EA Sender Based Routing"
on Exchange Server.Send Connector
on Exchange Server.Routing Rule
in Sender Based Routing Manager
.“Sender Based Routing Agent” checks if current email message matches the routing rule based on Sender, Sender Group, Recipient, Headers or Subject conditions:
You can download EA Sender Based Routing for Exchange Server Installer and install it on your server.
Double click the installer file and the installation will be executed automatically. The installer requires Exchange Server 2007 SP1/2010/2013/2016/2019 to be installed. If no Exchange Server is detected in your operating system, Setup will be aborted.
After the installation is completed, click “Sender Based Routing Manager” from Windows
Start menu
-> All Programs
-> “EA Sender Based Routing”
to begin the setup.
Note
Installation Permission
An account with Administrative Privileges is required to run the installer for installing “Send Based Routing” on Exchange Server.
Important
After the installation is complete, I strongly suggest that you check “Microsoft Exchange Transport Service”
and “Microsoft Exchange Mail Submission Service” in Control Panel
-> Administrative Tools
-> Services
, and check if those services are running,
if not, start them manually.
For example, if you want to relay all emails from domain “mysenderdomain.com”
using a specified Send Connector
,
you would create a new Send Connector
from the
Exchange Admin Center
(https://yourserver/ecp
) -> mail flow
-> Send Connectors
,
and name it as mysenderdomain.com.sbr
.
Note
In Exchange 2007/2010, you should use Exchange Management Console
->
Organization Configuration
-> Hub Transport
-> Send Connectors
to
create a new Send Connector
.
Then select Next
, select "MX record associated with recipient domain"
or
"Route mail through smart hosts"
based on your environment. If you
selected "Route mail through smart hosts"
, add your smart host to the hosts list.
Important
For Exchange Server is 2007 - 2013, you must use a smart host (Route mail through smart hosts
) in
this Send Connector, otherwise, your email will get SMTPSEND.DNS.NonExistentDomain
error.
For Exchange 2013 SP1 - 2019, you can use either “Route mail through smart hosts” or “MX record associated with recipient domain”.
Then select Next
, if you selected "Route mail through smart hosts"
,
set user authentication for your smart host based on your smart host requirement, default is none.
If you selected "MX record associated with recipient domain"
, this step is skipped.
Then select Next
, click the plus sign (+), and add mysenderdomain.com.sbr
into address space,
you need to input this address space
into "Sender Based Routing Rule"
at next section.
Click Next
, add your source servers and then Finish
.
After the above Send Connector
is created, we can create a routing rule
to use this Send Connector
.
Now we need to create a rule in "Sender Based Routing Manager"
to re-route the email to the Send Connector
created in previous section.
Here is how “Sender Based Routing Rule” works:
Open “Sender Based Routing Manager” from Windows Start menu
->
All Programs
-> “EA Sender Based Routing”
Routing Rules
-> New
;"if the sender address matches the following pattern"
;*@mysenderdomain.com
in Sender Address
, sender address supports wildcard (* and ?);mysenderdomain.com.sbr
in Address Space
, this is the address space
you have added in your Send Connector
.Finally, click Save
, after this rule is created, all emails from *@mysenderdomain.com
will be relayed by
“mysenderdomain.com.sbr” Send Connector.
You can enable Full Debug Log in Sender Based Routing Manager
-> Journal
, then send a test email
from *@mysenderdomain.com
, and check the log content to see if the rule works as expected.
Besides Sender Condition
, you can also add more conditions such as Header
, Sender Group
,
Recipient
and Subject
. The email message will
be re-routed to specified Send Connector
while the rule matches all conditions.
If you would create more complex conditions that "Sender Based Routing Manager"
doesn’t support,
you can combine Exchange built-in Transport Rule
and Header Condition
like this:
Open Exchange Admin Center
(https://yourserver/ecp
) -> mail flow
-> rules
Note
In Exchange 2007/2010, you should use Exchange Management Console
->
Organization Configuration
-> Hub Transport
-> Transport Rules
to
create a new Transport Rule
.
"more options"
;"add conditions"
, add the conditions you want;"add action"
-> "Modify the message properties"
-> "Set the message header to this value"
"X-Reroute-Message"
, value is set to "yes"
Then create a rule in "Sender Based Routing Manager"
like this:
Routing Rules
-> New
;"if the sender address matches the following pattern"
;*@mysenderdomain.com
in Sender Address
, sender address supports wildcard (* and ?);X-Reroute-Message: yes
to Headers List
;mysenderdomain.com.sbr
in Address Space
, this is the address space
you have added in your Send Connector
.Combining with above Transport Rule
and Header Conditions
, the emails from *@mysenderdomain.com
with subject or body text including “reroute” will be re-routed to “mysenderdomain.com.sbr” Send Connector
.
If Sender Based Routing
is not working properly, you can enable full debug log like this:
Sender Based Routing Manager
-> Journal
-> change Log Level
to Full Debug
.Send Connector
.If there is no debug log generated after you enabled full debug log,
you should verify the installation of EA Sender Based Routing Agent
like this:
Open Exchange Management Shell and input:
Get-TransportAgent
press enter
You will see "EA Sender Based Routing Agent"
in the output.
If there is no "EA Sender Based Routing Agent"
in the output,
you can try to re-run the installer directly to fix
this issue, or contact our technical support team for assistance.
If you changed your custom send connector delivery setting (smart host or DNS MX), you should restart MsExchangeTransport
Service to take effect.
Restart-Service "MSExchangeTransport"
Not enough? Please contact our technical support team.
Remarks
We usually reply emails within 24hours. The reason for getting no response is likely that your SMTP server bounced our reply. In this case, please try to use another email address to contact us. Your Gmail, Hotmail or Office 365 email account is recommended.