J.B. Nicholson writes:
Ralph Seichter wrote:
Having had a shot at writing a robust mbox parser/converter myself, I came across numerous different formats/flavours, and frankly "mbox" is best avoided.
What is the recommended file format for mail archives to share?
This depends on requirements you haven't stated. If you have a "From munging" mail system that creates mboxes, your messages are already From-munged, and there's little point in going beyond the traditional ^From_-delimited mbox, which is quite safe and universally understood. (Unless for the sake of prettification you're willing to clean up the munged Froms pretty much by hand, as they sometimes can't be distinguished from quoting, and the fact that they're often quoted makes finding them non-trivial, too. Then go ahead, and when done use a reliable format.)
If you have a message-at-a-time system (as Mailman does, since it receives messages over a pipe -- Mailman 2, or LMTP -- Mailman 3), you have at least two good choices for single-file distribution:
MMDF
put it in a maildir and zip it up (for maximum portability; obviously if you know the target host(s), tar + compressor du jour is good too)
and one mediocre (but in some sense portable) one:
- From-munged mbox
Obviously MMDF and mbox can be compressed if you like. Note that both MMDF and maildir can be considered message-at-a-time, and each converted to the other. How you sort the stream is up to you, again depending on unstated requirements.
All of the above are widely understood by MUAs, and easily interconverted. If you have some other format, such as Content-Length, it's best to convert to one of the reliable (ie, well-defined and usually correctly implemented) ones, maildir or MMDF.
There are other reliable formats, such as Babyl as used by Emacs's RMail MUA, but simple is best.
Steve