log.debug( "retrieving messages from " + folderId + " ..." );
try {
IMailFolder currentFolder = mailbox.getMailFolderById( folderId );
if ( currentFolder == null ) {
mailbox.reloadFolder();
currentFolder = mailbox.getMailFolderById( folderId );
}
mailbox.setCurrentFolder( currentFolder );
Message[] msgs = currentFolder.retrieveMessages( sortField, ascending, searchFields, searchValues );