From: Markus Valentin Date: Thu, 22 Jun 2023 07:58:08 +0000 (+0200) Subject: dbox: dbox_mailbox_check_existence() - Do always check for index_path existence X-Git-Tag: 2.4.0~2631 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc07f87f797490a9173c52fa158ac54c9e42fb35;p=thirdparty%2Fdovecot%2Fcore.git dbox: dbox_mailbox_check_existence() - Do always check for index_path existence --- diff --git a/src/lib-storage/index/dbox-common/dbox-storage.c b/src/lib-storage/index/dbox-common/dbox-storage.c index e3d648712f..176f663478 100644 --- a/src/lib-storage/index/dbox-common/dbox-storage.c +++ b/src/lib-storage/index/dbox-common/dbox-storage.c @@ -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) {