TL;DR
I'm trying to get a reasonably fast and efficient search of the entire mailbox with the EWS API, targeting Exchange 2010. Is this possible?
This problem has been bugging me for a while. When using third party email clients that use EWS you can tell that others struggle with this topic aswell. These are the things I've tried so far:
Creating a
SearchFolder
withTraversal="Deep"
for all items with the classIPM.Note
and themsgfolderroot
-folder as base folder. For a user with a sufficient amount of emails, this is not sustainable, since this operation will throttle immediately, essentially creating a DOS for that particular user.Same as above, but adding an additional
Rectriction
restricting theitem:DateTimeReceived
to a week at a time. I guess this works OK when the mail the user is looking is relatively new, but will not work if it is an old email.Find all the user's folder ids and search all these folders in paralell with the AQS-parameter set to the search query the user gave. This throttles the server as well.
Same as above, but search all the folders in series. This is OK for users with few mails in their mailbox and if they have few folders, but does not go fast enough for users with large mailboxes.
Is there a reasonably fast way to search the entire mailbox with EWS? I'm targeting Exchange 2010.