final Session session = Session.getDefaultInstance(props);
session.setDebug(isDebug());
final Store store = session.getStore(transport);
store.connect(getLogin(request), getPassword(request));
final POP3Folder inbox = (POP3Folder) store.getFolder("INBOX");
inbox.open(Folder.READ_WRITE);
final FetchProfile profile = new FetchProfile();
profile.add(UIDFolder.FetchProfileItem.UID);
final Message[] messages = inbox.getMessages();
inbox.fetch(messages, profile);