On 16/05/25, Kurt Hackenberg ([email protected]) wrote:
> > I was just confused because the earlier post had seemed
> > to imply that this was not done / needed for MBOXCL2.
> 
> It's not, because that variant has Content-Length:.
> 
> Let's say you want to put multiple variable-length chunks of text in a
> single file. When you want to read one of those chunks, how do you find the
> end? It can only work if whatever wrote the file supplied extra information.
> It can either put a marker after each chunk of text, or put the length of
> each chunk before it.

On 15/05/25, Will Yardley ([email protected]) wrote:
> Right, totally understand all of this, but where I'm confused is that if
> the claim is that Mutt uses Mboxcl2 (as I think the man page for mbox(5)
> implies, and also as it adds the Content-Length header) it shouldn't
> _need_ to escape the "From " lines in message bodies, but it does anyway.
> 
> My guess is that maybe it does this is in service of the Robstness
> principle and / or to maintain compatibility with other mbox
> implementations?

Thank you both for giving more information about the history of this subject.

I assume the "Content-Length" (and possibly also "Lines"?) was, as Kurt 
suggests, a way of efficiently reading emails out of a larger mbox file.

I'm thinking, for my own purposes, if scanning lines of a file for lines 
starting "From " and then checking if the line is a valid "postmark" line, and 
either the first line in the file or preceeded by an empty line, and followed 
by a valid header line. I'm hoping this is a robust approach (unfortunately I 
can't work out how mutt does it so fast from the C sources.) Using this 
scanning approach I could have multiple scanners, each stopping if they hit a 
previously seen byte offset of a postmark line or EOF.

I've just seen that some of my emails saved from mutt in 2005 have both 
"Content-Length:" and "Lines:" headers, which might also be useful!

Thanks very much,
Rory

Reply via email to