From: Timo Sirainen Date: Mon, 29 Nov 2021 17:34:43 +0000 (+0100) Subject: pop3c: Add missing lookup_abort and mail_stream_accessed handling X-Git-Tag: 2.3.18~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f2e3b3d3768dbc15980faabe494997bc6a193de;p=thirdparty%2Fdovecot%2Fcore.git pop3c: Add missing lookup_abort and mail_stream_accessed handling --- diff --git a/src/lib-storage/index/pop3c/pop3c-mail.c b/src/lib-storage/index/pop3c/pop3c-mail.c index c1cbe005a1..3b660745dc 100644 --- a/src/lib-storage/index/pop3c/pop3c-mail.c +++ b/src/lib-storage/index/pop3c/pop3c-mail.c @@ -147,6 +147,7 @@ static bool pop3c_mail_prefetch(struct mail *_mail) if (pmail->imail.data.access_part != 0 && pmail->imail.data.stream == NULL) { + _mail->mail_stream_accessed = TRUE; capa = pop3c_client_get_capabilities(mbox->client); pmail->prefetching_body = (capa & POP3C_CAPABILITY_TOP) == 0 || (pmail->imail.data.access_part & (READ_BODY | PARSE_BODY)) != 0; @@ -206,6 +207,11 @@ pop3c_mail_get_stream(struct mail *_mail, bool get_body, } if (mail->data.stream == NULL) { + if (_mail->lookup_abort != MAIL_LOOKUP_ABORT_NEVER) { + mail_set_aborted(_mail); + return -1; + } + _mail->mail_stream_accessed = TRUE; capa = pop3c_client_get_capabilities(mbox->client); if (get_body || (capa & POP3C_CAPABILITY_TOP) == 0) { cmd = t_strdup_printf("RETR %u\r\n", _mail->seq);