From Academic Kids

Mbox is the name for several different things, including


The mbox family of mailbox formats

mbox is a generic term for a family of related file formats used for holding collections of electronic mail messages. In these formats, the messages are concatenated in a single file, with a From line prepended to the beginning of each and a blank line appended to the end of each. The From line begins with the five characters "From ", and may continue with other text.

Unlike Internet protocols for email exchange, mbox was never formally defined through the RFC standardization mechanism. The storage of email is an exercise left entirely to the implementer of the MUA (Email Client).

The family comprises four main different formats, each to varying extents incompatible with the three others. According to a naming scheme developed by Daniel J. Bernstein, Rahul Dhesi, and others in 1996, these are mboxo, mboxrd, mboxcl, and mboxcl2. Their differences from one another stem from their origins in the various different mail tools for the various different flavours of Unix (mboxcl and mboxcl2 have their origins in the file format used by Unix System V Release 4 mail tools, for example), apart from mboxrd, which was invented by Rahul Dhesi et al. as a rationalisation of mboxo and subsequently adopted by some Unix mail tools including qmail.

'From' quoting

Two out of the four mbox variants, mboxo amd mboxrd, locate the starts of messages by scanning for From lines. Thus if the string "From " occurs at the beginning of any line in either the headers or the body of a message (unlikely for the former for correctly formatted messages, but likely for the latter), it must be modified when the message is stored in a mbox mailbox file to prevent the line from being taken as a message boundary. This is typically done by prepending a greater-than sign.

Idiosyncratic variations

In addition to the four varieties mentioned above, there are further incompatible mbox variations employed by some MUAs for their own, private, mail folders:

  • Eudora employs an mboxo variant in which the sender's email address is replaced by the constant string "???@???".
  • The Mozilla family of MUAs (Mozilla, Netscape, Thunderbird, et al.) employ an mboxrd variant with different and more complex From line quoting rules.

File locking

Because more than one message is stored in a single file, some form of file locking is needed to avoid the corruption that can result from two or more processes modifying the mailbox simultaneously, such as in the case (for example) of a mail delivery program delivering a new message at the same time as a mail reader is deleting an existing message.

For historical reasons similar to those that have resulted in the various incompatible file formats, various incompatible file locking mechanisms exist: fcntl(), lockf(), and "dot locking". Because of the mutual incompatibility, because of the problems that these locking mechanisms encounter with network mounted file systems (such as NFS), and because of the inefficiency of and vulnerability to corruption and loss of mailbox contents of various operations (such as deleting a message), mbox mailbox formats have waned in popularity during the past decade in favour of the maildir mailbox format.

Alternatives to mbox

As already mentioned, maildir is one alternative to the mbox family of mailbox formats. Both mbox and maildir store messages in (pretty much) their original Internet Message (RFC 2822) form, in areas directly accessible to the users owning the mailboxes (and, often, subject to those users' disk space quota limits).

Other systems, such as Microsoft Exchange Server and the Cyrus IMAP server store mailboxes in centralised databases managed by the mail system and not directly accessible by individual users.

The rise of Unicode vs. ASCII for text representation presents another area in which the mbox format is showing its age; although, via MIME character encodings such as UTF-8, the Internet Message Format can encode Unicode data quite simply (and often more efficiently in terms of storage space than a UTF-16 mailbox format would).


From Sat Aug 03 2002
Received: from ... by ... with ESMTP;
Subject: Nonsense
From: <>
To: <>

>From ancient times, people have been writing letters.

From someoneelse@loa.invalid Sun Aug 04 2002
Received: from ... by ... with SMTP
Subject: Iggeret
To: <you@aoeu.snth>

Ha iggeret hazot niktava blashon ivrit.

External links



Academic Kids Menu

  • Art and Cultures
    • Art (
    • Architecture (
    • Cultures (
    • Music (
    • Musical Instruments (
  • Biographies (
  • Clipart (
  • Geography (
    • Countries of the World (
    • Maps (
    • Flags (
    • Continents (
  • History (
    • Ancient Civilizations (
    • Industrial Revolution (
    • Middle Ages (
    • Prehistory (
    • Renaissance (
    • Timelines (
    • United States (
    • Wars (
    • World History (
  • Human Body (
  • Mathematics (
  • Reference (
  • Science (
    • Animals (
    • Aviation (
    • Dinosaurs (
    • Earth (
    • Inventions (
    • Physical Science (
    • Plants (
    • Scientists (
  • Social Studies (
    • Anthropology (
    • Economics (
    • Government (
    • Religion (
    • Holidays (
  • Space and Astronomy
    • Solar System (
    • Planets (
  • Sports (
  • Timelines (
  • Weather (
  • US States (


  • Home Page (
  • Contact Us (

  • Clip Art (
Personal tools