From: Timo Sirainen Date: Mon, 29 Nov 2021 17:35:31 +0000 (+0100) Subject: lib-storage: raw: get_stream() - Add missing lookup_abort and mail_stream_accessed... X-Git-Tag: 2.3.18~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e06ee029f63c411ad0ef1a6d8721ecdd7a5c799e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: raw: get_stream() - Add missing lookup_abort and mail_stream_accessed handling --- diff --git a/src/lib-storage/index/raw/raw-mail.c b/src/lib-storage/index/raw/raw-mail.c index b8bbb87cd9..2e9033ae31 100644 --- a/src/lib-storage/index/raw/raw-mail.c +++ b/src/lib-storage/index/raw/raw-mail.c @@ -85,6 +85,11 @@ raw_mail_get_stream(struct mail *_mail, bool get_body ATTR_UNUSED, struct index_mail *mail = INDEX_MAIL(_mail); if (mail->data.stream == NULL) { + if (_mail->lookup_abort != MAIL_LOOKUP_ABORT_NEVER) { + mail_set_aborted(_mail); + return -1; + } + _mail->mail_stream_accessed = TRUE; /* we can't just reference mbox->input, because index_mail_close() expects to be able to free the stream */ mail->data.stream =