Is there a way to fetch the mail bodies of multiple emails with a single call to an IMAP server using the Javamail API?
I know I can get to the body of a given message using the Message.getContent() call, but this ends up doing a call to the imap server for each individual message.
Is it possible to use the FetchProfile and Folder.fetch call to bulk fetch bodies? The documentation implies that the FetchProfile is only for header data. I tried the following, but that didn't do the trick:
FetchProfile fp = new FetchProfile();
fp.add("rfc822.text");
inbox.fetch(messages, fp);
If it is not possible to do this using Javamail, is it due to a constraint in the Javamail API or does the IMAP protocol simply not support this?