*** dovecot-1.0.0/src/lib-storage/index/mbox/istream-raw-mbox.c 2007-03-14 00:32:37.000000000 +0900 --- dovecot-1.0.0-fix/src/lib-storage/index/mbox/istream-raw-mbox.c 2007-05-25 20:23:07.000000000 +0900 *************** *** 243,255 **** i++; from_after_pos = i; from_start_pos = i - 6; ! if (from_start_pos > 0 && ! buf[from_start_pos-1] == '\r') { ! /* CR also belongs to it. */ ! crlf_ending = TRUE; from_start_pos--; ! } else { crlf_ending = FALSE; } } fromp = mbox_from; --- 243,260 ---- i++; from_after_pos = i; from_start_pos = i - 6; ! ! if (from_start_pos > 2 && ! memcmp(buf + from_start_pos - 3, ! "\r\n\r", 3) == 0) { from_start_pos--; ! crlf_ending = TRUE; ! } else if (from_start_pos > 0 && ! buf[from_start_pos - 1] == '\n') { crlf_ending = FALSE; + } else { + from_start_pos = (size_t)-1; + from_after_pos = (size_t)-1; } } fromp = mbox_from;