]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Added a separate prefix for server metadata that aren't deleted with...
authorTimo Sirainen <tss@iki.fi>
Tue, 17 Sep 2013 20:32:57 +0000 (23:32 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 17 Sep 2013 20:32:57 +0000 (23:32 +0300)
src/lib-storage/index/index-storage.c
src/lib-storage/mail-storage.h

index 50da9e6112dc5843758b1c8d4c053d4333c6d729..1336fe08ca5b4ee413feb3cf23c9759f37e95530 100644 (file)
@@ -614,9 +614,15 @@ mailbox_delete_all_attributes(struct mailbox_transaction_context *t,
        struct mailbox_attribute_iter *iter;
        const char *key;
        int ret = 0;
+       bool inbox = t->box->inbox_any;
 
        iter = mailbox_attribute_iter_init(t->box, type, "");
        while ((key = mailbox_attribute_iter_next(iter)) != NULL) {
+               if (inbox &&
+                   strncmp(key, MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVER,
+                           strlen(MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVER)) == 0)
+                       continue;
+
                if (mailbox_attribute_unset(t, type, key) < 0)
                        ret = -1;
        }
index 81d4b76179a8cc5bcec77a4679ab846103e778c5..7c54047cb78610f3bd03609a49311ac7e195e7ed 100644 (file)
@@ -209,7 +209,12 @@ enum mailbox_sync_type {
 #define MAILBOX_ATTRIBUTE_PREFIX_DOVECOT "vendor/vendor.dovecot/"
 /* Prefix used for attributes reserved for Dovecot's internal use. Normal
    users cannot access these in any way. */
-#define MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT "vendor/vendor.dovecot/pvt/"
+#define MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT \
+       MAILBOX_ATTRIBUTE_PREFIX_DOVECOT"pvt/"
+/* Prefix used for server attributes in INBOX. INBOX deletion won't delete
+   any attributes under this prefix. */
+#define MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVER \
+       MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT"server/"
 
 enum mail_attribute_type {
        MAIL_ATTRIBUTE_TYPE_PRIVATE,