From ec5d2e1653c52984e0ad02596be628ed9c68c38e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 16 Feb 2018 16:03:46 +0200 Subject: [PATCH] doveadm sync/backup: Don't override BROKENCHAR if it's already set This allows migrating invalid mailbox names by specifying BROKENCHAR. Previously it would always try to use \003 control character, which isn't valid character in mailbox names so the mailbox creation would fail. --- src/doveadm/doveadm-dsync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index 65ec0b0a40..8226a71989 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -323,8 +323,10 @@ static void doveadm_user_init_dsync(struct mail_user *user) struct mail_namespace *ns; user->dsyncing = TRUE; - for (ns = user->namespaces; ns != NULL; ns = ns->next) - ns->list->set.broken_char = DSYNC_LIST_BROKEN_CHAR; + for (ns = user->namespaces; ns != NULL; ns = ns->next) { + if (ns->list->set.broken_char == '\0') + ns->list->set.broken_char = DSYNC_LIST_BROKEN_CHAR; + } } static bool paths_are_equal(struct mail_user *user1, struct mail_user *user2, -- 2.47.3