Dynamics CRM 2011 Email Router Errors Tracking Emails

Paul Nieuwelaar, 02 April 2013

#9628 - An error occurred while delivering the e-mail message with subject "subject" in mailbox example@email.com for delivery to http://localhost/org.

We had an issue with one of our customers using the Email Router with CRM IFD where the router failed to connect to CRM using the localhost address. After some investigation we found that the Email Router needed to use the CRM URL defined in Deployment Manager, even though CRM and the Email Router were on the same server. After changing this and restarting the email router, all was well again. 

SCENARIO:

• CRM and Email Router are on the same server.
• CRM is configured for IFD.
• Email Router connects to CRM using http://localhost/org.
• Errors occur stating the URL was not found. 


TO RESOLVE:

1. Open CRM Deployment Manager, right click Microsoft Dynamics CRM, and select Properties. On the Web Address tab make note of the Web Application Server.
2. In the Email Router settings, change the CRM deployment to use the full CRM URL from the CRM Deployment Manager.
3. Restart the Email Router service.
4. Errors should disappear. 


FULL ERROR DETAILS IN EVENT VIEWER:

#9628 - An error occurred while delivering the e-mail message with subject "subject" in mailbox example@email.com for delivery to http://localhost/org. System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://domain.com/org/XRMServices/2011/Organization.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.

   at System.Net.HttpWebRequest.GetResponse()

   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 

#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. Microsoft.Crm.Tools.Email.Providers.EmailException: Error: A folder with the specified name already exists.

   at
Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.LogEwsResponseErrorWarning(String message, ResponseClassType responseClassType)

   at
Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.MoveMessage(EmailMessage emailMessage)

   at
Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.MoveMessageIfNeeded(Exception e, EmailMessage emailMessage)

   at
Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.HandleDeliverMessageError(Exception e, EmailMessage emailMessage)

   at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()

   at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteProviderWork(Object providerQueueRequestObject)