public List<Message> getMessages() throws Throwable {
List<Message> messageList = null;
try {
Folder folder = this.getCurrentFolder();
folder.open(Folder.READ_ONLY);
CurrentFolderMessagesInfo folderInfos = (CurrentFolderMessagesInfo) this.getRequest().getSession().getAttribute(CurrentFolderMessagesInfo.CURRENT_FOLDER_MESSAGES);
//if (this.hasToReloadMessages(folder, folderInfos)) {
Message messages[] = folder.getMessages();
FetchProfile profile = new FetchProfile();
profile.add(FetchProfile.Item.ENVELOPE);
folder.fetch(messages, profile);
this.setOpenedFolder(folder);
messageList = Arrays.asList(messages);
this.orderMessages(messageList);
folderInfos = new CurrentFolderMessagesInfo(this.getCurrentFolderName(), messageList);
this.getRequest().getSession().setAttribute(CurrentFolderMessagesInfo.CURRENT_FOLDER_MESSAGES, folderInfos);
//} else {
// messageList = folderInfos.getMessages();
//}
} catch (Throwable t) {