]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: fts_index_get_header() - Open the mailbox to access the index if not opened yet
authorMarco Bettini <marco.bettini@open-xchange.com>
Wed, 6 Sep 2023 15:31:58 +0000 (15:31 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Tue, 10 Oct 2023 08:04:41 +0000 (08:04 +0000)
src/plugins/fts/fts-api.c

index 1f8ea0966384be1f75243af4c468cef772947043..6a8a393052488c6ffc4d2a128569dbedcb4caa59 100644 (file)
@@ -549,6 +549,11 @@ bool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r)
        size_t data_size;
        bool ret;
 
+       if (box->index == NULL && mailbox_open(box) < 0) {
+               i_zero(hdr_r);
+               return FALSE;
+       }
+
        mail_index_refresh(box->index);
        view = mail_index_view_open(box->index);
        mail_index_get_header_ext(view, fts_index_get_ext_id(box),