decide if that is an error or not. (for example we
could be coming here from IMAP APPEND when IMAP
client has closed the connection too early. we
- don't want to log an error in that case.) */
- if (parser_input->stream_errno != 0 &&
- parser_input->stream_errno != EPIPE) {
+ don't want to log an error in that case.)
+ Note that EPIPE may also come from istream-mail which
+ detects a corrupted message size. Either way, the
+ body wasn't successfully parsed. */
+ if (parser_input->stream_errno == 0)
+ ;
+ else if (parser_input->stream_errno == EPIPE)
+ ret = -1;
+ else {
index_mail_stream_log_failure_for(mail, parser_input);
ret = -1;
}