dovecot-2.2: lib-storage: Added a separate prefix for server met...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Sep 17 23:33:06 EEST 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/194383b51917
changeset: 16763:194383b51917
user: Timo Sirainen <tss at iki.fi>
date: Tue Sep 17 23:32:57 2013 +0300
description:
lib-storage: Added a separate prefix for server metadata that aren't deleted with INBOX.
diffstat:
src/lib-storage/index/index-storage.c | 6 ++++++
src/lib-storage/mail-storage.h | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diffs (36 lines):
diff -r 393c389b1540 -r 194383b51917 src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c Tue Sep 17 23:12:03 2013 +0300
+++ b/src/lib-storage/index/index-storage.c Tue Sep 17 23:32:57 2013 +0300
@@ -614,9 +614,15 @@
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 -r 393c389b1540 -r 194383b51917 src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h Tue Sep 17 23:12:03 2013 +0300
+++ b/src/lib-storage/mail-storage.h Tue Sep 17 23:32:57 2013 +0300
@@ -209,7 +209,12 @@
#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,
More information about the dovecot-cvs
mailing list