From: Marco Bettini Date: Wed, 6 Sep 2023 15:31:58 +0000 (+0000) Subject: fts: fts_index_get_header() - Open the mailbox to access the index if not opened yet X-Git-Tag: 2.4.0~2525 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32b016f9b809f7062ab65dc290ee7738c887ca3c;p=thirdparty%2Fdovecot%2Fcore.git fts: fts_index_get_header() - Open the mailbox to access the index if not opened yet --- diff --git a/src/plugins/fts/fts-api.c b/src/plugins/fts/fts-api.c index 1f8ea09663..6a8a393052 100644 --- a/src/plugins/fts/fts-api.c +++ b/src/plugins/fts/fts-api.c @@ -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),