bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mbox bugs?


From: Kurt Hackenberg
Subject: Re: Mbox bugs?
Date: Sat, 29 Jan 2022 21:17:31 -0500

Sergey,

I did some more testing, and found that when movemail converts mbox to
other formats, it adds a spurious blank line to all of dotmail, MH
format, and maildir.

I tested with an input message whose body is one line, in mbox and
dotmail formats.  The table below shows the results.  In both input
and output messages, "bad" means the message has a blank line added,
so the message body is two lines; "good" means the message has no
extra blank line.

         to     mbox    dotmail MH      maildir
from
good mbox       good    bad     bad     bad
good dotmail    good    good    good    good
bad dotmail     good    bad     bad     bad

So I guess the mbox code, on read, appends a blank line to the message
in memory.  On write, something more complicated happens.  Maybe it
does three different things if the message in memory ends with 0, 1,
or 2 blank lines?

Looks like the others are straightforward: drop the file format stuff
on read, add it on write, without otherwise modifying the message.

Seems it would be simpler, and all these conversions would work, if
the mbox code were also straightforward: drop the blank line on read,
write a blank line after the message on write.

That blank line in mbox format causes endless confusion.  Over the
years, many programmers have not been sure whether it's part of the
message.  I'm sure that it's not.

That blank line has no technical function.  I suspect that whoever
invented mbox just threw in a blank line so it would look nice when he
used cat to copy an mbox file to his printing terminal.  It's antique
decoration.

Attached are the three input files from the testing above.

Attachment: good_dog.mbox
Description: application/mbox

Attachment: good_dog.dotmail
Description: Text document

Attachment: bad_dog.dotmail
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]