Microsoft Dynamics CRM 2011 Email Router Errors

This article should help users troubleshoot error messages from the Microsoft Dynamics CRM 2011 Email Router they may receive.

 

These error messages that can be seen in the Event Viewer where the Email Router is installed, and when Email Router logging is enabled include:

#14494 - A provider work item using assembly: Microsoft.Crm.Tools.EmailProviders.dll and class: Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider has been aborted because it has been running for longer than the allowed execution time. .

#26234 - The E-mail Router service could not process a provider work item using assembly: Microsoft.Crm.Tools.EmailProviders.dll and class: Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider. System.Threading.ThreadAbortException:

#26090 - An error occurred while opening mailbox Microsoft.Crm.Tools.Email.Providers.EmailException

 

If you receive the above errors, your troubleshooting should start with the following actions in order:

Delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file.

Re-install the Email Router
Change the account that is running the email router service, for example Local System - Domain Account.
Set the below keys on CRM. Exchange, & SQL servers:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
MaxUserPort – Increase from current value (maximum is 65,534)
TcpTimedWaitDelay - 30

 

More information on MaxUserPort & TcpTimedWaitDelay keys are in the below:

https://technet.microsoft.com/en-us/library/cc758002(v=WS.10).aspx 

https://technet.microsoft.com/en-us/library/cc757512(v=ws.10).aspx 

 

Increase the maxthreadexecution in the Microsoft.Crm.Tools.EmailAgent.xml to <MaxThreadExecution>1200000</MaxThreadExecution>
Decrease the maxmessagespercycle to 250 and increase the pollingperiod to 120.

Edit the ConfigUpdatePeriod to 300000.

 

Increase the number of connections available in Microsoft.Crm.Tools.Email.Management.config, so it looks like:

<configuration>

<system.net>
<connectionManagement>
<add address="*" maxconnection = "24" />
</connectionManagement>
</system.net>

</configuration>

Create a new file called Microsoft.Crm.Tools.EmailAgent.exe.config and add:

<configuration>
<system.net>
<connectionManagement>
<add address="*" maxconnection = "24" />
</connectionManagement>
</system.net>
</configuration>

Restart the SQL, CRM and Exchange servers.

 

If you have a large number of CRM users using the Email Router and only a few incoming/ outgoing profiles, we recommend you create multiple profiles in the Email Router settings to increase performance.

For example, if you have 50 users and 1 incoming & 1 outgoing profile, create more so you would have 10 profiles, and 5 users in each.

 

Best Regards

Dynamics CRM Team