dovecot-1.2: lib-storage: If read-only mailbox uses private flag...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 25 18:09:20 EEST 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/c2c1639b91ee
changeset: 9573:c2c1639b91ee
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 25 16:07:43 2010 +0100
description:
lib-storage: If read-only mailbox uses private flags, don't return it as READ-ONLY.

diffstat:

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

diffs (22 lines):

diff -r 6f25b20b8367 -r c2c1639b91ee src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c	Tue May 25 15:56:03 2010 +0100
+++ b/src/lib-storage/index/index-storage.c	Tue May 25 16:07:43 2010 +0100
@@ -511,8 +511,16 @@
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
-	return (ibox->box.open_flags & MAILBOX_OPEN_READONLY) != 0 ||
-		ibox->backend_readonly;
+	if ((ibox->box.open_flags & MAILBOX_OPEN_READONLY) != 0)
+		return TRUE;
+
+	if (ibox->backend_readonly) {
+		/* return read-only only if there are no private flags
+		   (that are stored in index files) */
+		if (box->private_flags_mask == 0)
+			return TRUE;
+	}
+	return FALSE;
 }
 
 bool index_storage_allow_new_keywords(struct mailbox *box)


More information about the dovecot-cvs mailing list