changeset 22233:6d2107608c1b

imapc: Avoid sending FETCH BODY[HEADER] when BODY[] is already being fetched This probably only shows up in some special situations with plugins.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 13 Jun 2017 00:55:36 +0300
parents 1a38704403db
children 437360a243ee
files src/lib-storage/index/imapc/imapc-mail-fetch.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-mail-fetch.c	Tue Jun 13 18:26:26 2017 +0300
+++ b/src/lib-storage/index/imapc/imapc-mail-fetch.c	Tue Jun 13 00:55:36 2017 +0300
@@ -275,6 +275,7 @@
 			   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 @@
 	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;
 }