Best performance method for retrieving all messages on IMAP server?
920251Feb 27 2012 — edited Mar 8 2012Hello 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