]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm sync/backup: Don't override BROKENCHAR if it's already set
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 16 Feb 2018 14:03:46 +0000 (16:03 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 28 Feb 2018 11:15:14 +0000 (13:15 +0200)
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

index e5387d86c2734ec8067ff7d02e2eefb20e8e5d58..ea2eb678466fafe0f41bf11e162560f5afa4b245 100644 (file)
@@ -317,8 +317,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,