Ever got 'The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down' while re-starting the MS CRM Email Router Service.
The trace logged is :
"System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing."
Root Cause: The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is corrupted.
1. Browse to 'C:Program FilesMicrosoft CRM EmailService'. Delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file.
2. Restart the Microsoft Dynamics CRM E-mail Router Service.The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is re-created.
Read more at: http://support.microsoft.com/kb/954522