]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 17 Feb 2018 19:15:29 +0000 (21: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 46b5255230fcfc8593a7451b05cfc391c52b1fc2..3c73739f450c34d278a55856c58ab8703ada53ff 100644 (file)
@@ -326,8 +326,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,