changeset 20743:b3176b1a9e68

imapc: mail_get_stream() shouldn't return cached hdr_size
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 14 Sep 2016 18:57:43 +0300
parents ff4c5d5ee76f
children cf26a89ceb9a
files src/lib-storage/index/imapc/imapc-mail.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-mail.c	Tue Sep 13 22:54:02 2016 +0200
+++ b/src/lib-storage/index/imapc/imapc-mail.c	Wed Sep 14 18:57:43 2016 +0300
@@ -296,6 +296,10 @@
 	    mail->imail.data.stream != NULL) {
 		/* we've fetched the header, but we need the body now too */
 		index_mail_close_streams(&mail->imail);
+		/* don't re-use any cached header sizes. we may be
+		   intentionally downloading the full body because the header
+		   wasn't returned correctly (e.g. pop3-migration does this) */
+		data->hdr_size_set = FALSE;
 	}
 
 	if (data->stream == NULL) {