From: Timo Sirainen Date: Tue, 17 Sep 2013 20:32:57 +0000 (+0300) Subject: lib-storage: Added a separate prefix for server metadata that aren't deleted with... X-Git-Tag: 2.2.6~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a37fbef942ff122a59b91c8f6fc60858ea31661;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Added a separate prefix for server metadata that aren't deleted with INBOX. --- diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index 50da9e6112..1336fe08ca 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -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; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 81d4b76179..7c54047cb7 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -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,