/** * Partial implementation of list functionality. * TODO: Handle wildcards anywhere in store pattern * (currently only supported as last character of pattern) * * @see com.icegreen.greenmail.imap.ImapHostManager#listMailboxes */ private Collection<MailFolder> listMailboxes(GreenMailUser user, String mailboxPattern, boolean subscribedOnly) throws FolderException { List<MailFolder> mailboxes = new ArrayList<>(); String qualifiedPattern = getQualifiedMailboxName(user, mailboxPattern); for (MailFolder folder : store.listMailboxes(qualifiedPattern)) { // TODO check subscriptions. if (subscribedOnly && !subscriptions.isSubscribed(user, folder)) { // if not subscribed folder = null; } // Sets the store to null if it's not viewable. folder = checkViewable(folder); if (folder != null) { mailboxes.add(folder); } } return mailboxes; }