D. J. Bernstein <djb(_at_)cr(_dot_)yp(_dot_)to> writes:
Tony Hansen writes:
Whether parsing mboxcl2 takes "much" more code than parsing mboxrd is a
subjective measurement.
Here's complete awk code to count the number of messages in an mbox,
assuming mboxrd (or mboxo) format:
awk '/^From / { ++sum } END { print sum }'
Please show us your code to do the same thing with mboxcl2.
Remember that, if you don't check Content-Length, you'll sometimes break
messages at the wrong place. Also remember that Content-Length can be
capitalized and spaced strangely, maybe even across lines.
The other problem with Content-Length skipping N bytes is that it is
broken by CRLF conversion, which makes it harder to read same mbox
on Win32 and Unix (but not impossible).
It is also essential to "ignore" Content-Length that may be present in
the incomming mail and re-compute it as you write it to your local mbox.