EWS Pull notifications stop working on Exchange online

Our application uses EWS pull notifications to get emails from Exchange Online mailboxes. The application is authorized via admin account. Admin account is granted full access permissions to several user mailboxes. The application is able to collect all email items from user mailboxes. Here is a code sample:

var service = new ExchangeService()
{
    Credentials = new WebCredentials(AdminLogin, AdminPassword),
};
service.AutodiscoverUrl(AdminLogin, ValidateRedirectionUrlCallback);

var subscription = service.SubscribeToPullNotifications(new []{ new FolderId(WellKnownFolderName.Inbox, UserMailbox)},
    10,
    string.Empty,
    EventType.NewMail,
    EventType.Created,
    EventType.Modified,
    EventType.Moved);

foreach (var ev in subscription.GetEvents().AllEvents)
{
    Logger.Info("Event received {0}", ev.EventType);
}
subscription.Unsubscribe();

Recently the application stopped working. When calling GetEvents method application receives ServiceResponseException: "Exchange Web Services are not currently available for this request because none of the Client Access Servers in the destination site could process the request."

Our investigation shows that the application is not allowed to subscribe to user mailboxes when authorized as administrator. It looks like this feature was broken on Exchange Online instances with Exchange Server V2_34, because everything works on instances with previous version of Exchange Server Online V2_33.

Have you seen this kind of problems?

February 17th, 2015 10:43am

That error generally indicates you haven't used the X-AnchorMailbox header see http://support.microsoft.com/kb/2990048/en-us and https://msdn.microsoft.com/en-us/library/office/dn458789%28v=exchg.150%29.aspx  . You should use this header set to the UserMailbox for any delegate request in Office365.

Cheers
Glen
  • Marked as answer by vlad-enkata 2 hours 7 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 10:19pm

It works! You made my day, Glen!
February 18th, 2015 4:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics