web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Mail router failed to access mailboxes

(0) ShareShare
ReportReport
Posted on by
My CRM Mail Router stop working!
It was running during last month, but today I realized that mails are not sending. I suspect that I need to change the password of special Office 365 user that I am using for Mail Router. I reset his password and I am able successfully  login to Outlook web access. As well I can open other users mailboxes with this user.
I changed the password in Mail Router Configuration Manager, published, loaded deployment data but when I am trying Test Access I am getting:
Name: UserName
Incoming Status: Failure - The remote Microsoft Exchange e-mail server returned the error "(401) Unauthorized". Verify that you have permission to connect to the mailbox. The request failed with HTTP status 401: Unauthorized.
Server: https://podXXXXX.outlook.com/ews/exchange.asmx (mailrouter@sub.onmicrosoft.com)
Outgoing Status: Failure - An error occurred while checking the connection to e-mail server https://podXXXXX.outlook.com/ews/exchange.asmx. The request failed with HTTP status 401: Unauthorized.
 
 
In the Application Event log I found following events:
 
Fault bucket , type 0
Event Name: CRMmanaged
Response: Not available
Cab Id: 0
 
Problem signature:
P1: 5.0.9690.2165
P2: Microsoft.Crm.Tools.EmailAgent
P3: Microsoft.Crm
P4: Object reference not set to an instance of an object.;Hash='1347396225'
P5:
P6:
P7:
P8:
P9:
P10:
 
Attached files:
C:\Windows\Temp\tmp9F5D.tmp
 
These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\NonCritical_5.0.9690.2165_f5b611cfe3894abc42c7ea2fe56b47ed6beea3c0_cab_0f94a040
 
Analysis symbol:
Rechecking for solution: 0
Report Id: 22f57bb3-8406-11e1-9154-00155d016918
Report Status: 4
 
#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.ExchangeOnlinePollingSendEmailProvider. System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.HandleProcessMessageError(Exception exception, Entity emailMessage)
   at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()
   at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteProviderWork(Object providerQueueRequestObject)
 
#61042 - An error occurred while processing the outgoing e-mail message with subject "An Opportunity has been Won - Please Send Licenses CRM:0018179" for ExchangeOnline: https://dev.crm.dynamics.com/crmXXXXX for delivery through https://podXXXXX.outlook.com/ews/exchange.asmx. System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.Tools.Email.Providers.ExchangeServiceBinding.CreateItem(CreateItemType CreateItem1)
   at Microsoft.Crm.Tools.Email.Providers.ExchangeOnlinePollingSendEmailProvider.SendMessage(MessageType mailMessage)
   at Microsoft.Crm.Tools.Email.Providers.ExchangeOnlinePollingSendEmailProvider.ProcessMessageInternal(Entity emailMessage)
 
Any help will be appreciated!
 
Arkady.

*This post is locked for comments

I have the same question (0)
  • Francisco Ceia Profile Picture
    35 on at

    Have you checked this one?

    blogs.msdn.com/.../microsoft-dynamics-crm-4-0-e-mail-router-unexpectedly-stalls.aspx

    Regards,

    F

  • Arkady Karasin Profile Picture
    on at

    Thank you,

    I tried, but it wasn't solve my problem.

  • Donna Edwards Profile Picture
    2,996 on at

    Ensure you can log into CRM as the email router user.   Also check the services that are running with that user login and change passwords there as needed.

  • Arkady Karasin Profile Picture
    on at

    I can successfully login with this user to Dynamics and Office 365. I confirmed that this user can open all other users mailboxes in Exchange online.

    Actually I can't run services with this user. This user is not exist in our AD. I created it in Office 365 and using same live ID in Dynamics CRM.

    I tried to use my account (that have permissions to all mailboxes too) to run service. Same problem...

    In any case thank you,

    Arkady.

  • Donna Edwards Profile Picture
    2,996 on at

    I recommend that you use a user as the Service login for the Email Router that is a CRM user and has full Administrator rights on the O365 account and that exists as an admin in Active Directory.  This should work as I've used this approach in several implementations.  

    If you try the above and it does not work, then chances are that you've missed some required setting in O365

  • Arkady Karasin Profile Picture
    on at

    Can I use my account for test purposes?

    I see the problem because my account is verified with ADFS and not Exchange online itself.

    I will try it now.

  • Arkady Karasin Profile Picture
    on at

    Same...

    Most weird it is not able to open my mail box using my user account in mail router config and service login:

    #26090 - An error occurred while opening mailbox myuser@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 request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Crm.Tools.Email.Providers.ExchangeServiceBinding.GetFolder(GetFolderType GetFolder1) at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.OpenMailbox() at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.InitExchangeConnector() --- End of inner exception stack trace --- at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.WrapException(Exception e) at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.InitExchangeConnector() at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox() at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()\r\nSystem.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Crm.Tools.Email.Providers.ExchangeServiceBinding.GetFolder(GetFolderType GetFolder1) at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.OpenMailbox() at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.InitExchangeConnector()

     

  • Donna Edwards Profile Picture
    2,996 on at

    Does the account you are trying to use have ALL the rights I mentioned above to include Admin rights on Exchange Online, Admin rights in Active Directory and System Admin rights in CRM.  I've had people in the past tell me that the user account has all those rights to later find out that it didn't.

    Unfortunately the error message you are providing is not helping me identify the issue.

    If the user account does have the three rights I mentioned above then I suspect you are going to have to connect the email router to Exchange Online using something other than the discovery service URL.  In one implementation we had to use SMTP protocol to connect as we and Microsoft could not get the other URL to work.

  • Arkady Karasin Profile Picture
    on at

    Yes, generic account is Administrator on Office 365 portal, I can open other users mailboxes using this account. As I already mention it is not exist in AD. And it have all permissions on CRM.

    Mail router fails with this account.

    I tried my account as well. I have Admin rights for AD and it is federated account with Office 365. To login to CRM I am using my Live ID account, that is Administrator on CRM. And I am failed with this configuration too.

    I installed mail router on my home computer trying both accounts and the results are similar. I enabled logging for Mail Router but it is not providing too much information.

    I opened support incident for Office 365. For meantime you mentioned that you have other solution. Could you please point me to instructions.

    Thank you very much,

    Arkady.

  • Christian Fröwis Profile Picture
    on at

    Hello Karasin!

    We have the same problem. Did you find any solutions ...

    We get the same errors. We also tried it with the administrator account, but always the same message ...

    We tried to open the URL in the explorer and we get access.

    So I think our problem is not a setup problem. I hope Microsoft find a solution ...

    Have a nice day

    Christian

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans