static boolean isFolderVisible(Folder folder) {
static boolean isFolderVisible(Folder folder, ImapSession session) { if (session.isHackEnabled(ImapSession.EnabledHack.WM5)) { String lcname = folder.getPath().substring(1).toLowerCase(); if (lcname.startsWith("sent items") && (lcname.length() == 10 || lcname.charAt(10) == '/')) return false; }
    static boolean isFolderVisible(Folder folder) {        return folder != null &&               folder.getId() != Mailbox.ID_FOLDER_CONTACTS &&               folder.getId() != Mailbox.ID_FOLDER_CALENDAR &&               folder.getId() != Mailbox.ID_FOLDER_USER_ROOT &&               (!(folder instanceof SearchFolder) || ((SearchFolder) folder).isImapVisible());    }