A new property and two new methods have been added to the Chilkat IMAP component to make it easier to process mailboxes containing a large number of email messages. (This was prompted because of a customer need to process a mailbox with over 100,000 messages.)
The NumMessages property was recently added to the IMAP component. Whenever a mailbox is selected via the SelectMailbox method, the NumMessages property will be automatically updated to reflect the number of messages in the mailbox.
A mailbox will contain emails having sequence numbers ranging from 1 to NumMessages. Two new methods, FetchSequence and FetchSequenceHeaders, have been added to make it possible to download emails within a range of sequence numbers. A large mailbox can be processed by downloading and processing in chunks, perhaps 100 at a time.
Examples of using FetchSequence have been uploaded to example-code.com:
Note: The Search command is not used. In fact, it would be disastrous to do a search for "ALL" on a mailbox with 100,000 messages. The IMAP server would surely take a long, long time to respond.