Troubleshooting the Microsoft Dynamics CRM E-mail Router


This post will give you some steps and links to additional information on troubleshooting the different errors you may seen when clicking Test Access to test the configuration of the e-mail router.


In order to troubleshoot the E-mail Router you will want to know what E-mail Access Configuration is set of your users. To find out the configuration you can view each user’s record in CRM under Settings-Application-Users. Each user can have a different configuration like the following.


clip_image002


clip_image004


For more information on the configuration options see the Email Router Scenarios Document.


Troubleshooting Incoming E-mail


If you have an error type HTTP 401 (Unauthorized)


clip_image006


Make sure the user has logged into the mailbox so the mailbox is activated before clicking “Test Access”. Also verify you can receive E-mails into that mailbox.


Check the properties of E-mail Router Incoming profile



  1. Verify the correct URL of the Exchange server is entered.


a. http(s)://myexchangeserver


b. http(s)://www.myexchangeserver.local




    • You should not put anything at the end like “/OWA” or “/Exchange” or even a simple “/”.

    2. Check the Access Credentials to see what they are set to(LocalSystem, UserSpecified, OtherSpecified).



clip_image008


Make sure that the user that is set in the Access Credentials has Full rights to access to the mailboxes you are testing access for. To test this, try to logon to the Router machine with the account set in the Incoming profile (Or do a run as in IE), then try to access to the OWA URL of the User you are currently testing (http://exchangeserver/Exchange/crmuser)


You can check these links below to give Mailbox rights to the user that is set in the Access Credentials of the Incoming Profile. For setting permissions on a mailbox in Exchange 2003 http://technet.microsoft.com/en-us/library/aa998707(EXCHG.65).aspx


For setting permissions on a mailbox in Exchange 2007, http://technet.microsoft.com/en-us/library/bb124097(EXCHG.80).aspx
http://mostlyexchange.blogspot.com/2007/02/granting-permissions-to-mailboxes-in.html


3. If User Specified is used in the access Credentials then make sure the user that you are trying to connect to has set their username and password in Tools-Options as the router will use those credentials to access the users mailbox.
Note: The User Specified option is used in the scenario where the router is monitoring user mailboxes. This would be when the users E-mail configuration is set to E-mail Router for the Incoming Profile.clip_image010


If you have an error type HTTP 400 (Bad Request), HTTP 404 (Not Found), HTTP 502 Bad Gateway, or The Remote name could not be resolved:


clip_image012


clip_image014


Make sure the Exchange URL you entered in the E-mail Router Incoming profile is correct, the syntax must be:



1. http(s)://myexchangeserver


2. http(s)://www.myexchangeserver.local


    a. You should not put anything at the end like “/OWA” or “/Exchange” or even a simple “/”.


Check IIS Logs on Exchange Server to see what Virtual Directory it is failing on (ExAdmin or Exchange)



1. IIS 6 – %SystemDrive%\WINDOWS\system32\LogFiles


2. IIS 7 – %SystemDrive%\inetpub\logs\LogFiles


Is SSL required on the Exadmin or Exchange virtual directory?



  • If so make sure to include https in the Exchange url when setting up the Incoming Profile.

Check if there is a Valid Certificate.



1. Do not use selfssl generated certificates


2. Try to navigate to the url that is set in incoming profile in IE


     a. http://servername/exchange/usermailbox


     b. Are there any Certificate Errors?


Check if Exchange 2007 roles are separated



  • If the Exchange Server roles are on separate machines make sure to use the Exchange server that is the mailbox server role when creating the incoming profile.

If you have an error type HTTP 404 (Not Found)


clip_image016


For Exchange 2007


Connect to the Exchange server (Mailbox Server) and in IIS Console Management, verify that the Virtual Directory we are using to connect to the mailboxes are present ( “Exadmin” or “Exchange”).
To do this, expand the default website in INETMGR, and check that EXADMIN folder is there.
If not, this is probably your problem; you will need to re-create it. The following KB Article gives a method to recreate the AD objects / IIS Metabase missing entries.
http://support.microsoft.com/kb/947802 You cannot connect to a clustered Exchange 2007 server through a server that has the Client Access Server (CAS) role installed by using the /exchange virtual directory


The issue could be the CRM User’s E-mail address information. The E-mail Address needs to be verified in CRM (check there is not mistyped address for instance).


For Exchange 2003


We need to make sure that the E-mail Address Login information is the same as the user’s Domain Name login.



Ex: User1 has the following properties set in CRM User Form:
DomainName: DOMAIN\user1
E-mailAddress: user1@domain.com


=> This works!


User2 has the following properties:
DomainName: DOMAIN\user2
E-mailAddress: CRM.User@domain.com
=> This will fail!


For the moment, we have a workaround for customers experiencing this. Here is how to do it based on the example above.


NOTE: If you are using Exchange 2007 you shouldn’t face this problem.


1. Make sure CRM User’s properties are set to use the E-mail Address they want (CRM.User@domain.com)


2. Configure the E-mail Router using the Configuration Manager, publish the changes.


3. Stop the E-mail Router Service. Open Microsoft.Tools.Crm.EmailAgent.Xml file in an editor like notepad.


4. On top of the file, set ConfigUpdatePeriod = 0


5. Modify each CRM User’s incoming profile like this:




<ProviderConfiguration deploymentId=”071e0a6e-649a-44da-a658-79dbffccfbe8″> <ProviderAssembly>Microsoft.Crm.Tools.EmailProviders.dll</ProviderAssembly>
<ProviderClass>Microsoft.Crm.Tools.Email.Providers.ExchngePollingMailboxProvider</ProviderClass><CrmServerUrl>http://crmserver:5555/MSCRMOrg</CrmServerUrl> <CrmAuthMode>WindowsAuthentication</CrmAuthMode>
<EmailServer>https://mail.ex.com</EmailServer>
<EmailAuthMode>WindowsAuthentication</EmailAuthMode>
<EmailUser>DOMAIN\User2</EmailUser>
<EmailPassword>{2A48C4DB-F2BFZ3g==@MkoEoFd1wvV8bY8UijX7VA==</EmailPassword> <EmailAddress>CRM.User@domain.com</EmailAddress>
<Target>User2</Target>
<Direction>Inbound</Direction>
etc…..
Change ONLY the SUFFIX: CRM.User into User2 like this: <EmailAddress>User2@domain.com<EmailAddress>


6. Save the file and restart the E-mail Router service.


NOTE: No need to perform the TEST ACCESS it will not work! If you want to check if the Router is working, monitor the trace and errors and do real tests. The test access will pick up the information from the CRM Server directly and not from the File, thus the “Fix” will not be used.


If test access does work, but you are receiving 404 errors in the application event log when processing E-Mail messages.



There is a known issue if Exchange 2007 is on Windows 2008 (IIS7). If you check the IIS logs for this 404 Error you will find that the exact status is:


    Request Filtering: Denied because URL doubled escaping 404.11


To address this you need to allow double escaping on the Exchange website by running this command:


%windir%\system32\inetsrv\appcmd set config “Default Web Site” -section:system.webServer/security/requestfiltering -allowDoubleEscaping:true


Find more information here:
http://technet.microsoft.com/en-us/library/cc754791.aspx
http://learn.iis.net/page.aspx/143/how-to-use-request-filtering/


If you have an error type HTTP 440 (Login Timeout)



  • This usually is due to not using Windows Authentication (only supported authentication method) but Forms Based Authentication. You need to change the authentication mode to Windows Authentication on the Mailbox Server . http://support.microsoft.com/kb/954047 ,

  • Make sure to point the Incoming Profile to the Exchange server with the mailbox server is and where the ExAdmin and Exchange virtual directories are.

You can also check this: http://blog.networkfoo.org/?p=195


Troubleshooting Outgoing E-mail


“Outgoing status: Failure – An error occurred while checking the connection to e-mail server EXSERVERNAME. The requested address is not valid in its context”


If the Outgoing Test is failing during Test Access:



  • Perform a simple telnet command to verify that connectivity between CRM Router and Exchange is fine.
    Ex: TELNET EXSERVERNAME PORT

  • Ensure you don’t have any Antivirus services running on the machine preventing calls on port 25.

  • See http://support.microsoft.com/kb/915827 for steps on configuring SMTP server to allow relay messages from Microsoft Dynamics CRM.

Troubleshooting Loading Data


When Clicking on Load Data you receive the following error.


The E-mail Router Configuration Manager was unable to retrieve user and queue information from the Microsoft Dynamics CRM server. This may indicate that the Microsoft Dynamics CRM server is busy. Verify that URL ‘http://hansoncrm5:5555/MSCRm’ is correct. Additionally, this problem can occur if specified access credentials are insufficient. To try again, click Load Data. (The organization name in the URL is case-sensitive. You must type the organization name in the URL exactly as it appears in the Microsoft Dynamics CRM server. To view the organization name as it appears in the Microsoft Dynamics CRM server, start the Web application. The organization name is displayed in the upper-right corner of the application.)



  • Make sure the account that is running the Microsoft CRM 4.0 E-mail Router Service is added to the PrivUserGroup Security Group in Active Directory.

  • The Account that is specified for the Access Credentials needs to be a CRM Admin User. If the Access Credentials are set to Local System then the computer Account needs to be a member of the PrivUserGroup Security Group in Active Directory.

  • Make sure the url is spelled correctly as it is case sensitive for the Organization Name.

  • DeploymentProperties table may have incorrect values if you have modified the port or hostheaders on your website. To update the DeploymentProperties table see http://support.microsoft.com/kb/950248

Additional Information


If unable to start the Microsoft CRM Email Router service start here http://support.microsoft.com/kb/954522


Incoming Status: Failure – The E-mail Router service configuration parameter “Emailuser” is missing. This parameter is required. http://support.microsoft.com/kb/947094


Email Router Scenarios Doc http://www.microsoft.com/downloads/info.aspx?na=22&p=1&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d8ea05b4e-825a-4db1-ad59-d894aa5ef33e%26DisplayLang%3den


Blog on how to enable tracing
http://blogs.msdn.com/benlec/archive/2008/03/25/how-to-implement-logging-for-the-microsoft-crm-4-0-e-mail-connector.aspx


Blog on E-Mail Connector Tracing tool
http://blogs.msdn.com/benlec/archive/2008/07/02/crm-4-0-e-mail-connector-logger-tool.aspx


Blog for troubleshooting
http://blogs.msdn.com/benlec/archive/2008/05/05/troubleshooting-crm-e-mail-issues-in-microsoft-crm-4-0.aspx


Info on virtual directories used for exchange
http://technet.microsoft.com/en-us/library/aa998849(EXCHG.80).aspx


Hotfixes
http://support.microsoft.com/kb/954549 (In Update Rollup 1)
http://support.microsoft.com/kb/952019 (In Update Rollup 1)
http://support.microsoft.com/kb/951849 (In Update Rollup 1)
http://support.microsoft.com/kb/959248 (Coming In Update Rollup 2)


Kind Regards,
The Microsoft CRM Support Team

Comments (11)

  1. We do get the 404 error testing the incoming connection, but the prcedure described in the KB article 947802 you refer to is incorrect for our SBS 2008 Server. The SBS 2008 server was installed normally and the virtual directories are clearly not installed as standard, nor can they be created using your procedures.

  2. Phillip Ford says:

    We have the same problem as Hans, please tell me, how did you resolve this issue?

    404 error testing incoming connection, but using sbs2008 with exchange 2007 and virtual directories are not in default site.

    We added them and the E-mail router would work intermitantly, but threw errors.  Not sure what the proper solution is here.

    Phillip

  3. Brian says:

    Installed email router following your guide, but now cannot connect to Dynamics CRM. All services are started/enabled, SQL connection is fine, IIS is setup good but it just keeps trying to load when I try to connect to CRM. Never loads anything though.. Email router broke CRM 🙁

  4. used computer says:

    i am so pleased with this blog the information which has been given to us through a blog is extremly useful for me.i highly appreciate the blogger for doing this great effort.

  5. used computers says:

    I just stumbled upon your blog after reading your blog posts wanted to say thanks.i highly appreciate the blogger for doing  this effort.

  6. used computers says:

    The E-mail Router accepts the same command prompt parameters as Microsoft Dynamics CRM Server. To install the E-mail Router in quiet mode, that uses an XML configuration file that is named install-con fig.XML and that creates a log file that is named log.txt,run the Setup Exchange.exe command in the Exchange folder on the installation media,or download location of the Microsoft Dynamics CRM Server installation.

  7. warehouse says:

    It's always amazing reading or commenting on a blog from which we get a full knowledge. Same as here I have found some really interesting information which is simply a great boost to my knowledge.

  8. refurbished computers says:

    its realy great to read this as the blog is perfect and so awesome..

    and the steps which has shared by the blogger is good that how to get rid from this trouble shoot problem….

  9. dell gx270 says:

    Indeed a very good read! Very informative post with pretty good insight on all aspects of the topic! Will keep visiting in future too!

  10. refurbish used computer says:

    Indeed a very good read! Very informative post with pretty good insight on all aspects of the topic! Will keep visiting in future too!