dovecot-2.2: layout=maildir++: Don't list INBOX if it doesn't ma...
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 20 03:26:28 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/0b01fff98a04
changeset: 14347:0b01fff98a04
user: Timo Sirainen <tss at iki.fi>
date: Thu Mar 15 13:25:36 2012 +0200
description:
layout=maildir++: Don't list INBOX if it doesn't match the list patterns.
diffstat:
src/lib-storage/list/mailbox-list-maildir-iter.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diffs (29 lines):
diff -r 8fb3fd391d18 -r 0b01fff98a04 src/lib-storage/list/mailbox-list-maildir-iter.c
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c Thu Mar 15 12:59:41 2012 +0200
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c Thu Mar 15 13:25:36 2012 +0200
@@ -135,16 +135,20 @@
node = mailbox_tree_lookup(ctx->tree_ctx, inbox_name);
if (node != NULL)
node->flags &= ~MAILBOX_NONEXISTENT;
- } else {
+ return 0;
+ }
+
+ /* add the INBOX only if it matches the patterns */
+ match = imap_match(glob, inbox_name);
+ if (match == IMAP_MATCH_PARENT)
+ maildir_fill_parents(ctx, glob, FALSE, inbox_name);
+ else if (match == IMAP_MATCH_YES) {
node = mailbox_tree_get(ctx->tree_ctx, inbox_name, &created);
if (created)
node->flags = MAILBOX_NOCHILDREN;
else
node->flags &= ~MAILBOX_NONEXISTENT;
-
- match = imap_match(glob, inbox_name);
- if ((match & (IMAP_MATCH_YES | IMAP_MATCH_PARENT)) != 0)
- node->flags |= MAILBOX_MATCHED;
+ node->flags |= MAILBOX_MATCHED;
}
return 0;
}
More information about the dovecot-cvs
mailing list