]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Don't do temp file scanning for mailbox directories
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 20 Jun 2023 15:44:52 +0000 (18:44 +0300)
committermarkus.valentin <markus.valentin@open-xchange.com>
Wed, 21 Jun 2023 12:46:57 +0000 (12:46 +0000)
The intention was to delete any temporary mail files that have been left
behind by crashed processes, but mail files are written to storage/
directory.

src/lib-storage/index/dbox-common/dbox-storage.c
src/lib-storage/index/dbox-common/dbox-storage.h
src/lib-storage/index/dbox-single/sdbox-storage.c

index 2f4ad057df5c79a634f45e99466087db12ebe0b2..b54d5117353a454b8ac5ad70da47b07a6950509e 100644 (file)
@@ -285,7 +285,7 @@ int dbox_mailbox_open(struct mailbox *box)
        return 0;
 }
 
-static void dbox_mailbox_close_cleanup(struct mailbox *box)
+void dbox_mailbox_close_cleanup(struct mailbox *box)
 {
        if (box->view == NULL)
                return;
@@ -322,7 +322,6 @@ static void dbox_mailbox_close_cleanup(struct mailbox *box)
 
 void dbox_mailbox_close(struct mailbox *box)
 {
-       dbox_mailbox_close_cleanup(box);
        index_storage_mailbox_close(box);
 }
 
index a6c4f7d8d1fe1b721bbd231adb115594b05d5917..6ec670d5d142241d9f3d600fdd730cdd094ace6d 100644 (file)
@@ -76,6 +76,7 @@ void dbox_notify_changes(struct mailbox *box);
 int dbox_mailbox_check_existence(struct mailbox *box);
 int dbox_mailbox_open(struct mailbox *box);
 void dbox_mailbox_close(struct mailbox *box);
+void dbox_mailbox_close_cleanup(struct mailbox *box);
 int dbox_mailbox_create(struct mailbox *box,
                        const struct mailbox_update *update, bool directory);
 int dbox_mailbox_create_indexes(struct mailbox *box,
index ecdb207b930bf2e323dad23227345cc104264bcf..ffcb121fe9477eaccc7e8d94c895384e9bb2eb03 100644 (file)
@@ -375,6 +375,7 @@ static void sdbox_mailbox_close(struct mailbox *box)
        if (mbox->corrupted_rebuild_count != 0)
                (void)sdbox_sync(mbox, 0);
 
+       dbox_mailbox_close_cleanup(box);
        dbox_mailbox_close(box);
 }