Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Best performance method for retrieving all messages on IMAP server?

920251Feb 27 2012 — edited Mar 8 2012
Hello all,

I am currently using the JavaMail API for retrieving e-mails on IMAP and IMAPS servers. The typical number of mails is between 10000 and 50000.

From what I have read on the FAQ, the current behavior is the following: to avoid out of memory errors, a FETCH IMAP command is used each time we will use a getContent() or a getInputStream() for a message.

Unfortunatly, this behavior seems to be costly performance-wise in my case, as my application will be often asked to retrieve every mail on the server.

I have used the FetchProfile items to boost performance as much as possible, but, content-wise, this did not seem possible.

Hence my question: how can I retrieve as much body contents as possible in one fetch? Or is there a workaround that would not imply working directly at the IMAPProtocol level?


Thank you in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2012
Added on Feb 27 2012
9 comments
6,529 views