// fetch messages
// Note: Not preloading CONTENT_INFO. For some reason, preloading the content info (IMAP BODYSTRUCTURE)
// causes the call to getContent to return empty. (As if there was a bug where getContent saw the cached
// body structure and thought that the content itself was cached, but I'd think a bug like that would have
// been found by many people and fixed long ago, so I'm assuming it's something else.)
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
Message[] msgs = inputFolder.getMessages();
inputFolder.fetch(msgs, fp);
log.debug("About to process {} messages", msgs.length);