I would like to get a list of everyone who has ever been included in any message in my inbox. Right now I can use the javax mail API to connect via IMAP and download messages:
Folder folder = imapSslStore.getFolder("[Gmail]/All Mail"); folder.open(Folder.READ_ONLY); Message[] messages = folder.getMessages(); for(int i = 0; i < messages.length; i++) { // This causes the message to be lazily loaded and is slow String[] from = messages[i].getFrom(); }
Linear messages [i] .getFrom () are slower than I would like, because this leads to lazy loading of the message. Can I do something to speed it up? For instance. Is there some kind of bulk upload that I can do instead of downloading messages one by one? Does this load the entire message, and is there something I can do to only load fields / headers / cc / cc or headers? Will POP be faster than IMAP?
source share