So I am trying to figure out how to get messages with UIDs
IMAPStore store = (IMAPStore) session.getStore("imaps");
store.connect();
IMAPFolder folder = (IMAPFolder) store.getFolder(FOLDER_NAME);
folder.open(Folder.READ_ONLY);
Then I want to search the folder:
Message unreadMessages[] =
folder.search(new FlagTerm( new Flags(Flags.Flag.SEEN), false));
But the messages in the array are returned without UIDs, so how do I pull them out later for processing without an ID to reference them by?