dovecot-2.2: lib-storage: Header+body searches might not have se...

dovecot at dovecot.org dovecot at dovecot.org
Fri Oct 11 12:23:03 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/78081ecd7eb3
changeset: 16840:78081ecd7eb3
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Oct 11 12:22:56 2013 +0300
description:
lib-storage: Header+body searches might not have searched the body in some cases.
Only the header was requested for the search stream, which with imapc and
pop3c could have caused the body not to be in the stream, although it
usually was because of the "fetch body" hint.

diffstat:

 src/lib-storage/index/index-search.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 69179ca6007d -r 78081ecd7eb3 src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c	Thu Oct 10 20:50:10 2013 +0300
+++ b/src/lib-storage/index/index-search.c	Fri Oct 11 12:22:56 2013 +0300
@@ -679,7 +679,10 @@
 		input = NULL;
 	} else if (have_headers) {
 		/* we need to read the entire header */
-		if (mail_get_hdr_stream(ctx->cur_mail, NULL, &input) < 0)
+		ret = have_body ?
+			mail_get_stream(ctx->cur_mail, NULL, NULL, &input) :
+			mail_get_hdr_stream(ctx->cur_mail, NULL, &input);
+		if (ret < 0)
 			failed = TRUE;
 		else {
 			hdr_ctx.parse_headers =


More information about the dovecot-cvs mailing list