diff -ruN dovecot-1.0.rc2.orig/src/lib-storage/index/mbox/istream-raw-mbox.c dovecot-1.0.rc2/src/lib-storage/index/mbox/istream-raw-mbox.c
--- dovecot-1.0.rc2.orig/src/lib-storage/index/mbox/istream-raw-mbox.c	2006-06-24 22:44:09.000000000 +0200
+++ dovecot-1.0.rc2/src/lib-storage/index/mbox/istream-raw-mbox.c	2006-07-11 16:51:32.000000000 +0200
@@ -193,7 +193,7 @@
 
 	if (stream->istream.v_offset == rstream->from_offset) {
 		/* beginning of message, we haven't yet read our From-line */
-		if (pos == 2) {
+		if (pos == 2 && ! stream->istream.eof) {
 			/* we're at the end of file with CR+LF linefeeds?
 			   need more data to verify it. */
 			rstream->input_peak_offset =
