This project is read-only.

Routing specific users via a different send connector (Exchange 2010 SP2)

Oct 24, 2012 at 11:30 AM

Hi All,

Had a requirement for routing mail from specific users to via a separate send connector.

Have the following set up and seems to be working now.

Normal Send connector for all users for *.

Second send connector for dummy domain reroute.local

Create DG with users that need to use reroute send connector.

Create transport rule so that members of that DG sending to outside the organisation have X-MS-Exchange-Organisation-RoutingRuleDomain set with 'reroute.local'

As I understand, this field just tells it which connector to use and doesn't rewrite anything else in the headers. So far so good.

A couple of things; when mail from these users go out, I get the following error in Event Log.

Log Name:      ApplicationSource:        RoutingRuleAgentDate:          24/10/2012 11:08:12Event ID:      10Task Category: NoneLevel:         ErrorKeywords:      ClassicUser:          N/AComputer:      servermail01.domain.com. Description:Exception (OnRouted): The message has been deferred.   at Microsoft.Exchange.Transport.TransportMailItemWrapper.ThrowIfDeferred()   at Microsoft.Exchange.Transport.TransportMailItemWrapper.get_Message()   at RoutingRuleAgent.RoutingRuleAgent.RoutingRuleAgent_OnRoutedMessage(RoutedMessageEventSource source, QueuedMessageEventArgs e)Event Xml:<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">  <System>    <Provider Name="RoutingRuleAgent" />    <EventID Qualifiers="0">10</EventID>    <Level>2</Level>    <Task>0</Task>    <Keywords>0x80000000000000</Keywords>    <TimeCreated SystemTime="2012-10-24T10:08:12.000000000Z" />    <EventRecordID>80029</EventRecordID>    <Channel>Application</Channel>    <Computer>servermail01.domain.com</Computer>    <Security />  </System>  <EventData>    <Data>Exception (OnRouted): The message has been deferred.   at Microsoft.Exchange.Transport.TransportMailItemWrapper.ThrowIfDeferred()   at Microsoft.Exchange.Transport.TransportMailItemWrapper.get_Message()   at RoutingRuleAgent.RoutingRuleAgent.RoutingRuleAgent_OnRoutedMessage(RoutedMessageEventSource source, QueuedMessageEventArgs e)</Data>  </EventData></Event>

Is this expected behaviour?

The second step is the following.

All standard users to route mail via the primary send connector.

All members of the rerouting DG to send mail to specific domains via the reroute connector, and the rest via the primary send connector.

I tried configuring the second send connector with the correct domains and setting a high cost, but mail from standard users still appeared to route via the reroute connector.

What would be the best way of achieving this configuration?

All the best,

N.

Oct 24, 2012 at 11:33 AM
Edited Oct 24, 2012 at 11:49 AM

Actually,

I think I have answered my own question,

the solution to part two would be to add the specific domains to the transport rule

'when a recipient's address matches domain.com, or domain2.com'

Hope this helps anyone else looking to do similar.

Nov 19, 2013 at 7:42 AM
For the "Exception (OnRouted): The message has been deferred." exception, it was raised by
EventLog.WriteEntry("RoutingRuleAgent", "Exiting OnRouted for message " + e.MailItem.Message.MessageId.ToString() + ".", EventLogEntryType.Information, 9);

I added strMessageID in the very beginning and change the EventLog.WriteEntry to use strMessageID. This resolved the unexpected exception.
void RoutingRuleAgent_OnRoutedMessage(RoutedMessageEventSource source, QueuedMessageEventArgs e)
{
try
{
    String strMessageID = e.MailItem.Message.MessageId.ToString();
    ...
     if (eventLogLevel >= 5)
          EventLog.WriteEntry("RoutingRuleAgent", "Exiting OnRouted for message " + strMessageID + ".", EventLogEntryType.Information, 9);
}
Catch(...)
{
 ... 
}
}