dovecot-2.2: lib-storage: If mail_attribute_dict is set, ignore ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 8 10:42:26 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/e027fa256c55
changeset: 19132:e027fa256c55
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 08 13:41:21 2015 +0300
description:
lib-storage: If mail_attribute_dict is set, ignore non-authority rank internal attributes.
This way dsync can still sync things like Sieve scripts, but it doesn't
attempt to sync anything that actually requires dict.

diffstat:

 src/lib-storage/mailbox-attribute.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 4b581d735292 -r e027fa256c55 src/lib-storage/mailbox-attribute.c
--- a/src/lib-storage/mailbox-attribute.c	Tue Sep 08 13:30:21 2015 +0300
+++ b/src/lib-storage/mailbox-attribute.c	Tue Sep 08 13:41:21 2015 +0300
@@ -100,7 +100,7 @@
 
 static void
 mailbox_internal_attributes_get(enum mail_attribute_type type,
-	const char *prefix, ARRAY_TYPE(const_string) *attrs)
+	const char *prefix, bool have_dict, ARRAY_TYPE(const_string) *attrs)
 {
 	const struct mailbox_attribute_internal *regs;
 	struct mailbox_attribute_internal dreg;
@@ -136,8 +136,8 @@
 			/* remove prefix */
 			key += plen + 1;
 		}
-
-		array_append(attrs, &key, 1);
+		if (have_dict || regs[i].rank == MAIL_ATTRIBUTE_INTERNAL_RANK_AUTHORITY)
+			array_append(attrs, &key, 1);
 	}
 }
 
@@ -357,13 +357,15 @@
 	struct mailbox_attribute_iter *iter;
 	ARRAY_TYPE(const_string) extra_attrs;
 	const char *const *attr;
-	
+	bool have_dict;
+
 	iter = box->v.attribute_iter_init(box, type, prefix);
 	i_assert(iter->box != NULL);
 
 	/* check which internal attributes may apply */
 	t_array_init(&extra_attrs, 4);
-	mailbox_internal_attributes_get(type, prefix, &extra_attrs);
+	have_dict = box->storage->set->mail_attribute_dict[0] != '\0';
+	mailbox_internal_attributes_get(type, prefix, have_dict, &extra_attrs);
 
 	/* any extra internal attributes to add? */
 	if (array_count(&extra_attrs) == 0) {


More information about the dovecot-cvs mailing list