]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: If read-only mailbox uses private flags, don't return it as READ-ONLY.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 15:09:14 +0000 (16:09 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 15:09:14 +0000 (16:09 +0100)
--HG--
branch : HEAD

src/lib-storage/index/index-storage.c

index ed276b256334a6c7ebdb60badd86676d2c84fc14..85a531c1ea8d95e618b340764a21e0821fee344c 100644 (file)
@@ -510,8 +510,16 @@ int index_storage_mailbox_rename(struct mailbox *src, struct mailbox *dest,
 
 bool index_storage_is_readonly(struct mailbox *box)
 {
-       return (box->flags & MAILBOX_FLAG_READONLY) != 0 ||
-               box->backend_readonly;
+       if ((box->flags & MAILBOX_FLAG_READONLY) != 0)
+               return TRUE;
+
+       if (box->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)