The E-mail Router service could not run the service main background thread error when starting the Microsoft Dynamics CRM E-mail Router Service

This article provides a resolution for the issue that when you start the Microsoft Dynamics CRM E-mail Router Service, you may receive The E-mail Router service could not run the service main background thread error.

Applies to:   Microsoft Dynamics CRM 2011
Original KB number:   954522

Symptoms

When you try to start the Microsoft Dynamics CRM E-mail Router Service in Microsoft Dynamics CRM, the following Error event is logged in the Application log:

The E-mail Router service could not run the service main background thread

Cause

This problem occurs because the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is corrupted.

Resolution

To resolve this problem, follow these steps:

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

    Note

    • By default, the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is in the following folder:C:\Program Files\Microsoft CRM Email\Service.
    • By default, the Service folder is a hidden folder. To see this folder, you must change the Windows Explorer settings to display hidden files and hidden folders.
  2. Restart the Microsoft Dynamics CRM E-mail Router Service.

    The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is re-created.

If Microsoft Dynamics CRM users are set to use the Email Router, and not a Forward Mailbox, for incoming email, there is a possibility of deleted emails returning to Microsoft Dynamics CRM after implementing this resolution. If an email has not been deleted from the user's mailbox, the Email Router could find a user's email in their Inbox, not find it in Microsoft Dynamics CRM, and create the email in Microsoft Dynamics CRM again. To avoid this, the email should also be deleted from the user's mailbox along with Microsoft Dynamics CRM.

To avoid this situation, regularly take a backup of the following files and store them on the desktop of the same server.

  • Microsoft.Crm.Tools.EmailAgent.Configuration.bin
  • Microsoft.Crm.Tools.EmailAgent.SystemState.Xml

If the Microsoft Dynamics CRM Email Router Configuration Manager fails at launch or the Microsoft Dynamics CRM Email Router service fails to start, replace the above two files in C:\Program Files\Microsoft CRM Email\Service. Restart the Microsoft Dynamics CRM Email Router service and then launch the Microsoft Dynamics CRM Email Router Configuration Manager. If the backup of these files is latest, then it will have the complete configuration of the Email Router.

References

For more information, see Error Email configuration manager was not able to read configuration information occurs when you launch the Microsoft Dynamics CRM Email Router Configuration Manager.