Common mbox Variations

Since there is no standard, every implementor seems to have changed the mbox format somewhat. In fact, the mbox format that we described previously is not the original but the most common variation. It is known as “mboxrd” after Rahul Dhesi.

Some of the other mbox-like formats have been used enough to be given names. Here are some examples:

  • The original mbox format (mboxo) only quotes From_lines, not quoted From_ lines. It is rarely used now.

  • mboxcl is mboxo, but with a Content-Length field in the From_line, which provides the number of bytes in the message. It is rarely used, either.

  • mboxcl2 is mboxcl without any From_ line quoting in messages (since the content length is given). It is used in a few Unix MUAs.

  • MMDF is an mbox-like format that uses neither From_ lines or trailing blank lines, but instead surrounds each message with four Control-As (^A^A^A^A). pine also supports this format.

  • The Eudora mail reader uses mbox as described in the previous section but does not add blank lines to the end of messages. It also uses the string ???@??? instead of the sender’s address in From_ lines.

  • Netscape uses mbox format, including blank lines, but uses “-” in place of the sender’s address in From_ lines.

Obviously, if you are attempting to parse an mbox mailbox, you should be careful to write a robust script! You may not know in advance which variation might have been used or whether you can count on items like the sender’s address being present.

Mailboxes of this type ...

Get Programming Internet Email now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.