From: Timo Sirainen Date: Tue, 25 May 2010 15:09:14 +0000 (+0100) Subject: lib-storage: If read-only mailbox uses private flags, don't return it as READ-ONLY. X-Git-Tag: 2.0.beta6~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af0251201fd396141ab3dbdcabb92a5390331ccf;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: If read-only mailbox uses private flags, don't return it as READ-ONLY. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index ed276b2563..85a531c1ea 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -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)