On Thu, May 15, 2025 at 11:26:00PM -0700, Will Yardley wrote:

On Fri, May 16, 2025 at 01:31:27AM -0400, Kurt Hackenberg wrote:
Mboxcl2 does it the other way. Instead of using a marker, it uses a length,
stored in the non-standard header Content-Length:. Software reads the
message header section and in there finds the length of the message body,
and then just reads that many bytes, and then it has the whole message. It
doesn't need to scan for the next mbox From_ line, so whatever wrote the
file didn't have to change any message lines that start with "From ", to
make them start with ">From " instead.

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.

No, it doesn't, by my testing. I tested it again just now, and confirmed that.

To test this, you need a message that contains a line that starts with "From ", and has never been written to an mbox file, so that line has never been modified. Then you can have Mutt write that message to an mbox file (with save or copy command), and look at that mbox file (with a low-level tool -- cat or a text editor).

The test will not be valid if that line has already been modified; Mutt will then pass along the ">From " line.

If your incoming mail is stored in an mbox file, either on your local computer or on an IMAP server, then you can't do this test with a message from there.

If necessary, you could create a minimal folder by hand, point Mutt at that, and save a message from there to a new mbox file. You could type a minimal mbox file with a text editor, but it would probably be less confusing to make an MH or maildir folder.

All right, I just made a maildir for this test. Tar file is attached. Save the tar file, extract the maildir from it (it's named test.maildir), do

    mutt -f test.maildir

have Mutt save the message to a new mbox file, cat that mbox file.

Also, cat the one message file in the maildir.

Attachment: test.maildir.tar
Description: Unix tar archive

Reply via email to