]> 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:21:15 +0000 (13:21 +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 65ec0b0a405713c571e3e8b812d10f2bed16ea26..8226a719898edb7d76b060acc1211cd794f3e3c8 100644 (file)
@@ -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,