This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

MBOX (.mbox, .mbx)

Unix mailbox format.
Holds a collection of electronic mail messages.
Native archive format of email clients such as Unix mail, Eudora, Mozilla, Netscape, and Thunderbird.
ASCII format.
Stores mailbox messages in their original format, with individual messages concatenated and separated by an empty line.
May contain binary attachment files using an ASCII representation.
Email applications normally use improved versions of the original Unix mbox format.
  • Import supports all common variants of the mbox file format.
  • Import imports an mbox file, returning the entire contents as rules.
  • Import returns an expression of the form , giving the individual mail messages in the form .
  • Import imports the specified element from an mbox file.
  • Import imports multiple elements.
  • The import format can be specified with Import["file", "MBOX"] or Import.
  • See Import for full general information.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Messages"list of mail messages, each given as rules representing the full header information, the message body, and possible attachments
"From"sender address
"ReplyTo"suggested address to which replies should be sent
"To"addresses of primary recipients
"Cc"addresses of other recipients
"Subject"message subject
"Date"message date, given as a DateList specification
"Data"message body
"Attachments"list of attachments, imported as a Mathematica expression if possible
"RawAttachments"attachments given as a list of raw strings
"RawData"list of messages as they appear in the mbox file
"EmailClient"email application used by the sender
"MIMEVersion"version of MIME protocol used if message is MIME formatted
  • Import by default uses the element.
  • General option:
CharacterEncoding"ISOLatin1"raw character encoding used in the file
This imports a sample MBOX file:
Extract message subjects from an MBOX file:
Import the message dates:
This imports a sample MBOX file:
Click for copyable input
Extract message subjects from an MBOX file:
Click for copyable input
Import the message dates:
Click for copyable input