]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: dbox_mailbox_check_existence() - Do always check for index_path existence
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 22 Jun 2023 07:58:08 +0000 (09:58 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Thu, 20 Jul 2023 09:28:22 +0000 (09:28 +0000)
src/lib-storage/index/dbox-common/dbox-storage.c

index e3d648712fe04cd34ef3fcebcc533e238237dbdd..176f663478d3b47912d939b835e3374817366189 100644 (file)
@@ -237,7 +237,7 @@ int dbox_mailbox_check_existence(struct mailbox *box)
        struct stat st;
        int ret = -1;
 
-       if (box->list->set.iter_from_index_dir) {
+       if (box->list->set.index_dir != NULL) {
                /* Just because the index directory exists, it doesn't mean
                   that the mailbox is selectable. Check that by seeing if
                   dovecot.index.log exists. If it doesn't, fallback to
@@ -256,6 +256,11 @@ int dbox_mailbox_check_existence(struct mailbox *box)
        }
        if (ret < 0) {
                ret = stat(box_path, &st);
+       } else if (ret == 0 && !box->list->set.iter_from_index_dir &&
+                  *box->list->set.mailbox_dir_name == '\0') {
+               /* There are index files for this mailbox and no separate
+               mailboxes directory is configured. */
+               return 0;
        }
 
        if (ret == 0) {