CRM 4 Email Router Setup/Troubles

When configuring the CRM 4 email router (installed on our Exchange 2007 server) we ran into a few problems. Hopefully by showing the problems I had and the fixes you’ll be able to deploy it issue free .

The first problem we had was:

Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
Date: 27/06/2008
Time: 12:40:55 PM
User: N/A
Computer: EXCHANGESERVER
Description:
#26090 – An error occurred while opening mailbox crm.mailbox@domain.com. Microsoft.Crm.Tools.Email.Providers.EmailException: The remote Microsoft Exchange e-mail server returned the error “(401) Unauthorized”. Verify that you have permission to connect to the mailbox. —> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.SubmitXmlCommand(HttpWebRequest httpWebRequest, String body)
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.RetrieveInboxUri()
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()
— End of inner exception stack trace —
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.WrapException(Exception e)
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()
at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()\r\nSystem.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.SubmitXmlCommand(HttpWebRequest httpWebRequest, String body)
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.RetrieveInboxUri()
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

This seemed to be caused by the fact that the OWA IIS site was set to “Require Secure Channel (SSL) & Require 128-bit Encryption”. So to fix this problem I set up a second OWA IIS Site with no SSL specifically for the CRM Router. To do this I used the following commands from the Exchange 2007 Management Shell:

  • New-OwaVirtualDirectory -OwaVersion:Exchange2007 -Name “owa” -WebSiteName “OWA-CRMRouter”
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchange” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Mailboxes
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exadmin” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exadmin
  • New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchweb” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exchweb

This set of commands creates the OWA directories in a new IIS site “OWA-CRMRouter”.

Hot Tip: To remove an OWA site you can use the following command from the Exchange 2007 Management Shell, Remove-OwaVirtualDirectory -Identity “owa (OWA-CRMRouter)”

Once this was done I reconfigured the CRM 4 Router to use the following settings:

  • E-Mail Server Type: Exchange
  • Authentication Type: Windows Authentication
  • Location: http://127.0.0.1 (Remember this site is only for the CRM Router so I had no reason to use a DNS name for the site. Also note it’s not https)
  • Access Credentials: Other Specified (I used the Forward mailbox user account and password)

Once this was done I tested my configuration from “Users, Queues, and Forward Mailboxes” -> “Forward Mailboxes” -> “Test Access”

This was the main issue I had. Along the way I also did the following:

  • Made sure the forward mailbox user had full permissions on its mailbox.
  • Logged into outlook using the forward mailbox user/email account.
  • Made sure the account running the “Microsoft CRM Email Router” service was part of the “PrivUserGroup” in Active Directory.
  • I also tested using POP3 but I wouldn’t recommend this as you then have to get each user to change there email settings in CRM. Even worse is if you have a mandatory password change every 30 days for example, they need to update this setting after changing there password every time. (I can imagine the support calls now)
  • For the outgoing email it was originally set to use Local System Account which would fail as it didn’t have permission to send emails. To fix this I changed the Account to the Forward mailbox user.

I Recieved this error when the Location server URL was incorrect for the incoming settings:

Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
Date: 18/06/2008
Time: 12:33:56 PM
User: N/A
Computer: EXCHANGESERVER
Description:
#26090 – An error occurred while opening mailbox crm.mailbox@domain.com. System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.SubmitXmlCommand(HttpWebRequest httpWebRequest, String body)
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.RetrieveInboxUri()
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()
at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

I also recived this error when the Location/server URL was using https with a URL not matching the SSL certificates Common Name:

Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
Date: 17/06/2008
Time: 4:25:19 PM
User: N/A
Computer: EXCHANGESERVER
Description:
#26090 – An error occurred while opening mailbox crm.mailbox@domain.com. System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. —> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
— End of inner exception stack trace —
at System.Net.HttpWebRequest.GetRequestStream()
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.SubmitXmlCommand(HttpWebRequest httpWebRequest, String body)
at Microsoft.Crm.Tools.Email.Providers.HttpDavRequest.RetrieveInboxUri()
at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()
at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

No votes yet