dovecot-2.2: dsync: Don't fail the sync if attribute couldn't be...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 10 13:41:28 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/8da591260f7c
changeset: 16259:8da591260f7c
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 10 13:40:57 2013 +0300
description:
dsync: Don't fail the sync if attribute couldn't be set.
It's probably a system configuration mismatch where some/all attributes
don't work in one system but do on another. This might or might not be a
problem, so it deserves an error message, but probably doesn't deserve
failing entirely.

diffstat:

 src/doveadm/dsync/dsync-mailbox-import.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (35 lines):

diff -r f39664bd4b29 -r 8da591260f7c src/doveadm/dsync/dsync-mailbox-import.c
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Wed Apr 10 00:14:09 2013 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Wed Apr 10 13:40:57 2013 +0300
@@ -350,7 +350,7 @@
 {
 	struct dsync_mailbox_attribute *local_attr;
 	struct mail_attribute_value value;
-	int ret, cmp;
+	int cmp;
 	bool ignore = FALSE;
 
 	i_assert(DSYNC_ATTR_HAS_VALUE(attr) || attr->deleted);
@@ -416,17 +416,17 @@
 	value.value = attr->value;
 	value.value_stream = attr->value_stream;
 	value.last_change = attr->last_change;
-	ret = mailbox_attribute_set(importer->trans, attr->type,
-				    attr->key, &value);
-	if (ret < 0) {
+	if (mailbox_attribute_set(importer->trans, attr->type,
+				  attr->key, &value) < 0) {
 		i_error("Mailbox %s: Failed to set attribute %s: %s",
 			mailbox_get_vname(importer->box), attr->key,
 			mailbox_get_last_error(importer->box, NULL));
-		importer->failed = TRUE;
+		/* the attributes aren't vital, don't fail everything just
+		   because of them. */
 	}
 	if (local_attr != NULL && local_attr->value_stream != NULL)
 		i_stream_unref(&local_attr->value_stream);
-	return ret;
+	return 0;
 }
 
 static void dsync_mail_error(struct dsync_mailbox_importer *importer,


More information about the dovecot-cvs mailing list