On Mon, 2008-10-27 at 14:29 -0700, Lennart Lövstrand wrote:
However, I also noted that there's a case which the fix doesn't cover,
and that's where the "From<space>" line appears as the first line of
the body of the message. When this happens, the body_offset will
point to the blank line between the headers and the body and not the
actual first line of the body. This will cause the stream to be
mispositioned at the time of the "From<space>" verification check in
istream_raw_mbox_get_body_size and the (actually correct)
expected_body_size will be rejected.I have enclosed a simple diff that will work around this by adjusting
the body_offset to point to the next line at the time of call to
istream_raw_mbox_is_valid_from in istream_raw_mbox_get_body_size.
This appears to handle the problem correctly in all the test cases I
have.
Thanks. I fixed it basically the same way but with a bit different code: http://hg.dovecot.org/dovecot-1.1/rev/9c3fa81a721d