Hi Trent,
Thanks for writing back to us.
I have analyzed the information and following are my findings:
tcromer:
From a performance perspective would your recommendation be to get a list of all messages and then filter/ignore those less than the Unique ID I last processed and only fetch messages of those that are greater, or would I be best to call ListMessage (or FetchMessage for that
matter) as per your example above based on the last unique idprocessed?
I am afraid that I could not find some performance benchmark against such a scenario. It seems to be a trade-off as in some cases if mailbox is very large but un-read messages are very less, then
ListMessage seems to be better whereas on the other hand if all the messages are un-read then may be getting list of all messages is more suitable method to process these messages. It can be tuned according to the requirements and no set rule can be defined.
tcromer:
Additionally, can I assume unique ID will always be numeric, it was a long value with the previous product I have used? How does this differ from sequence number and which of these should be use?
UniqueID is a numeric value which is remains unique such that if some message is deleted in mailbox, the UniqueID against that message is also deleted from the list and never assigned again to any message. However when a new message is added or a message is deleted from the
mailbox, sequence numbers are reset from 1.
For example there are 5 messages in inbox having sequence number and UniqueIDs as follows:
1,345
2,346
3,347
4,348
5,349
Now message having UniqueID 347 is deleted. Now the Seq No and
UniqueIDs will be as follows:
1,345
2,346
3,348
4,349
It is assumed that in the above scenario, from the beginning of mailbox, 344 messages are already deleted.
tcromer:
In addition to the above, is there a way in which I can pass a MailQuery to ListMessages and at the same time ask that only a maxNumberOfMessages are returned?
Currently this feature is not available. However we will discuss it with the development team and may log it as enhancement in our future versions. Could you please specify exactly how would you like to use this feature of MailQuery in conjunction with the ListMessages? We will look into its possible implementation at our end.