]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: maildir - Allow creating existing folder when rebuilding list index
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 20 Aug 2021 08:43:27 +0000 (11:43 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 7 Sep 2021 08:38:03 +0000 (08:38 +0000)
src/lib-storage/index/maildir/maildir-storage.c

index b400be3981742bb75c52dfe311c02780008e4ba7..bda53e15a49bb1c89d1e8e223ecfa79740b79e4d 100644 (file)
@@ -521,6 +521,9 @@ maildir_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
                       bool directory)
 {
        const char *root_dir, *shared_path;
+       /* allow physical location to exist when we rebuild list index, this
+          happens with LAYOUT=INDEX only. */
+       bool verify = box->storage->rebuilding_list_index;
        struct stat st;
        int ret;
 
@@ -528,7 +531,7 @@ maildir_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
                return ret;
        ret = 0;
        /* the maildir is created now. finish the creation as best as we can */
-       if (create_maildir_subdirs(box, FALSE) < 0)
+       if (create_maildir_subdirs(box, verify) < 0)
                ret = -1;
        if (maildir_create_maildirfolder_file(box) < 0)
                ret = -1;