dovecot-2.2: lib-storage: Mailbox list indexes are now enabled a...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 14:19:59 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/731046f18245
changeset: 15270:731046f18245
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 14:19:53 2012 +0200
description:
lib-storage: Mailbox list indexes are now enabled also for shared/public mailboxes.

diffstat:

 src/lib-storage/list/mailbox-list-index-status.c |  12 +++++++++++-
 src/lib-storage/list/mailbox-list-index-sync.c   |   4 +++-
 src/lib-storage/list/mailbox-list-index.c        |   5 -----
 3 files changed, 14 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 40e6e734cd5e -r 731046f18245 src/lib-storage/list/mailbox-list-index-status.c
--- a/src/lib-storage/list/mailbox-list-index-status.c	Mon Oct 29 14:19:24 2012 +0200
+++ b/src/lib-storage/list/mailbox-list-index-status.c	Mon Oct 29 14:19:53 2012 +0200
@@ -124,6 +124,13 @@
 
 	memset(status_r, 0, sizeof(*status_r));
 
+	if ((items & STATUS_UNSEEN) != 0 &&
+	    (mailbox_get_private_flags_mask(box) & MAIL_SEEN) != 0) {
+		/* can't get UNSEEN from list index, since each user has
+		   different \Seen flags */
+		return 0;
+	}
+
 	ret = index_list_open_view(box, &view, &seq);
 	if (ret <= 0)
 		return ret;
@@ -313,7 +320,10 @@
 		mailbox_list_index_refresh_later(box->list);
 	else {
 		/* get STATUS info using the given view, rather than
-		   using whatever state the mailbox is currently in */
+		   using whatever state the mailbox is currently in.
+		   note that for shared mailboxes (with private indexes) this
+		   also means that the unseen count is always the owner's
+		   count, not what exists in the private index. */
 		hdr = mail_index_get_header(view);
 
 		memset(&status, 0, sizeof(status));
diff -r 40e6e734cd5e -r 731046f18245 src/lib-storage/list/mailbox-list-index-sync.c
--- a/src/lib-storage/list/mailbox-list-index-sync.c	Mon Oct 29 14:19:24 2012 +0200
+++ b/src/lib-storage/list/mailbox-list-index-sync.c	Mon Oct 29 14:19:53 2012 +0200
@@ -290,10 +290,12 @@
 	mailbox_list_index_node_clear_exists(sync_ctx->ilist->mailbox_tree);
 
 	/* don't include autocreated mailboxes in index until they're
-	   actually created. */
+	   actually created. this index may be used by multiple users, so
+	   we also want to ignore ACLs here. */
 	patterns[0] = "*"; patterns[1] = NULL;
 	iter = sync_ctx->ilist->module_ctx.super.
 		iter_init(sync_ctx->list, patterns,
+			  MAILBOX_LIST_ITER_RAW_LIST |
 			  MAILBOX_LIST_ITER_NO_AUTO_BOXES);
 
 	sync_ctx->syncing_list = TRUE;
diff -r 40e6e734cd5e -r 731046f18245 src/lib-storage/list/mailbox-list-index.c
--- a/src/lib-storage/list/mailbox-list-index.c	Mon Oct 29 14:19:24 2012 +0200
+++ b/src/lib-storage/list/mailbox-list-index.c	Mon Oct 29 14:19:53 2012 +0200
@@ -522,11 +522,6 @@
 					&dir)) {
 		/* in-memory indexes */
 		dir = NULL;
-	} else if (list->ns->type != MAIL_NAMESPACE_TYPE_PRIVATE) {
-		/* don't create index files for shared/public mailboxes.
-		   their indexes may be shared between multiple users,
-		   each of which may have different ACLs */
-		dir = NULL;
 	}
 	i_assert(has_backing_store || dir != NULL);
 


More information about the dovecot-cvs mailing list