HowardS
HowardS

Reputation: 75

How should I handle a huge amount of mails with Chilkat?

I'm trying to fetch a huge amount of mails (2500 and more) from an IMAP-Server. Actually I'm using the imap.FetchHeaders() fuction but this is not THAT fast. Then I've tried the imap.FetchSingleHeader() but this is so much slower than imap.FetchHeaders()...

What would you recommend ??

Upvotes: 1

Views: 584

Answers (2)

Chilkat Software
Chilkat Software

Reputation: 1624

Thanks Howard, This is to answer your question in the comment above about GetMailboxStatus.

The GetMailboxStatus method sends a STATUS command requesting the following items: (MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)

Given that it's part of the IMAP protocol standard (at https://www.rfc-editor.org/rfc/rfc3501#section-6.3.10 ), it should be valid for all servers. (I don't recall ever fielding a support question where GetMailboxStatus did not work correctly.)

Upvotes: 2

Chilkat Software
Chilkat Software

Reputation: 1624

The imap.FetchHeaders() method will send a single IMAP command to fetch the headers. The IMAP server will send all headers in a single reply. The majority of the time it takes for the entire operation to complete is likely the IMAP server "think time", to process the request and send the response. If you turn on verbose logging (set the imap.VerboseLogging property = true) and then examine the contents of the imap.LastErrorText property, you should see timing information in elapsed milliseconds.

In summary, it's unlikely that fetching 2500 headers can be made any faster.

One note: To avoid problems we've seen when trying to fetch huge numbers of emails, Chilkat will send a maximum request of 1000 headers in a single request. This means that inside the FetchHeaders method (for the case of fetching 2500 headers), three separate request/response pairs will occur.

Upvotes: 2

Related Questions