dovecot-2.2: imapc: If imapc_list_prefix=INBOX, don't treat INBO...

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 30 22:05:17 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/eb57a7280b01
changeset: 15003:eb57a7280b01
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 28 19:06:01 2012 +0300
description:
imapc: If imapc_list_prefix=INBOX, don't treat INBOX/INBOX as the INBOX itself.

diffstat:

 src/lib-storage/index/imapc/imapc-list.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 6e53209030f6 -r eb57a7280b01 src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Tue Aug 28 18:53:30 2012 +0300
+++ b/src/lib-storage/index/imapc/imapc-list.c	Tue Aug 28 19:06:01 2012 +0300
@@ -345,6 +345,7 @@
 {
 	struct imapc_command *cmd;
 	struct imapc_simple_context ctx;
+	struct mailbox_node *node;
 	const char *pattern;
 
 	i_assert(list->sep != '\0');
@@ -364,16 +365,23 @@
 	mailbox_tree_deinit(&list->mailboxes);
 	list->mailboxes = mailbox_tree_init(list->sep);
 	mailbox_tree_set_parents_nonexistent(list->mailboxes);
+	imapc_simple_run(&ctx);
 
 	if ((list->list.ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {
 		/* INBOX always exists in IMAP server. since this namespace is
 		   marked with inbox=yes, show the INBOX even if
 		   imapc_list_prefix doesn't match it */
 		bool created;
-		(void)mailbox_tree_get(list->mailboxes, "INBOX", &created);
+		node = mailbox_tree_get(list->mailboxes, "INBOX", &created);
+		if (*list->storage->set->imapc_list_prefix != '\0') {
+			/* this listing didn't include the INBOX itself, but
+			   might have included its children. make sure there
+			   aren't any extra flags in it (especially
+			   \NonExistent) */
+			node->flags &= MAILBOX_CHILDREN;
+		}
 	}
 
-	imapc_simple_run(&ctx);
 	if (ctx.ret == 0) {
 		list->refreshed_mailboxes = TRUE;
 		imapc_list_delete_unused_indexes(list);


More information about the dovecot-cvs mailing list