From: Timo Sirainen Date: Fri, 11 Oct 2013 09:22:56 +0000 (+0300) Subject: lib-storage: Header+body searches might not have searched the body in some cases. X-Git-Tag: 2.2.7~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f41cfaa698846e782ba086ca61a8395d89ca551;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/lib-storage/index/index-search.c b/src/lib-storage/index/index-search.c index 0f10a04d15..a25a1be3e8 100644 --- a/src/lib-storage/index/index-search.c +++ b/src/lib-storage/index/index-search.c @@ -679,7 +679,10 @@ static int search_arg_match_text(struct mail_search_arg *args, 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 =