I have a program that subscribes to multiple Exchange 2010 mailboxes using EWS Managed API’s streaming notifications.
When I get a notification related to an item, I need to determine whose mailbox that item belongs to. I’m able to get the item’s ID and the parent folder’s ID, etc., but I don’t see any way to determine what mailbox the item belongs to.
Ok, so if I understand your application correctly you are using Impersonation and create subscriptions for all impersonated users. And when you receive event from subscription you want to know for which user this event occurred. If that is the case can’t you just keep your subscriptions mapped to user that subscription was created for?
Simple
Dictionary<StreamingSubscription, ImpersonateduserId>would be enoughAnd when you get notification you get subscription object from
NotificationEventArgs.Subscriptionproperty and find user id that subscription was created for in you map. FromImpersonatedUserIdyou can get smtp address (propertyId) and you know which exatcly user that was.