]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Avoid sending FETCH BODY[HEADER] when BODY[] is already being fetched
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Jun 2017 21:55:36 +0000 (00:55 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 16 Jun 2017 10:49:17 +0000 (13:49 +0300)
This probably only shows up in some special situations with plugins.

src/lib-storage/index/imapc/imapc-mail-fetch.c

index b481e7b5313b5cd69202ada52193a8889ad5207d..3fdb42a6e532734e5027accb86f8d6e16521a07b 100644 (file)
@@ -275,6 +275,7 @@ imapc_mail_send_fetch(struct mail *_mail, enum mail_fetch_field fields,
                           full body and sometimes only the headers. */
                        str_append(str, "BODY.PEEK[HEADER] BODY.PEEK[TEXT] ");
                }
+               fields |= MAIL_FETCH_STREAM_HEADER;
        } else if ((fields & MAIL_FETCH_STREAM_HEADER) != 0)
                str_append(str, "BODY.PEEK[HEADER] ");
        else if (headers != NULL) {
@@ -362,8 +363,7 @@ imapc_mail_get_wanted_fetch_fields(struct imapc_mail *mail)
        if (data->stream == NULL && data->access_part != 0) {
                if ((data->access_part & (READ_BODY | PARSE_BODY)) != 0)
                        fields |= MAIL_FETCH_STREAM_BODY;
-               else
-                       fields |= MAIL_FETCH_STREAM_HEADER;
+               fields |= MAIL_FETCH_STREAM_HEADER;
        }
        return fields;
 }