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.
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 =