Skip to content

Evidence methods guide

Mbox Message and Attachment Boundary Review: Separate Mailbox, Message, and MIME Parts

Review mbox format variation, separator lines, message header boundaries, MIME multipart delimiters, transfer encodings, and attachment metadata before extracting messages.

An mbox file is a sequence of messages, but the mailbox separator, Internet Message headers, MIME body, and attachment part are different boundaries. RFC 4155 also warns that mbox has many variations and that an mbox object transferred as a message attachment can become intermingled with a receiving mailbox. Start with the declared format and separator evidence, then parse RFC 5322 headers and MIME boundaries without confusing a filename or a body line with a message boundary. This guide is format guidance, not a mail reader, malware scanner, privacy decision, or permission claim.

Updated

On this page

Identify the mbox variant before splitting messages

Record a neutral file ID, digest, line ending style, declared media type and format parameter, first separator candidate, and the tool that produced the export. RFC 4155 says the mbox database format is not one authoritative historical format and recommends treating an unknown format parameter as opaque. Do not split every line beginning with From and call the result a message set.

The RFC 4155 and RFC 5322 source records carry verified publication months, September 2005 and October 2008. The RFC 2046 record keeps 22 October 2026 as its schema-compatible retrieval date, while the source ledger records its known November 1996 publication month separately. The checked day is retrieval evidence, not a publication claim.

Identify the mbox variant before splitting messages (table)
Boundary evidenceRecordStop if
Format parameterDeclared value or unknownAn unknown variant is treated as default
Separator lineFull line, sender token, timestamp, offsetOnly the prefix is matched
Message terminatorEmpty line and line endingEnd of file is assumed to terminate cleanly
Line endingLF, CRLF, or mixedNormalization hides source bytes
Body From lineLocation and escaping stateBody text is mistaken for a separator
Mailbox nestingAttachment or embedded mbox evidenceTwo mbox streams are merged

Preserve the raw separator line and its byte offset. RFC 4155 notes that it does not prescribe an escape syntax for body lines that begin with From space, so a parser must use the documented full separator form and a known variant policy rather than a guessed unescape rule.

Parse the Internet Message boundary independently

Within each candidate message, locate the RFC 5322 header section and the blank line that begins the body. Record header line folding, duplicate fields, malformed fields, and the parser’s recovery decision. A sender line in the mbox separator is not the same field as a From header inside the message. Keep envelope separator metadata and message headers in separate columns.

Parse the Internet Message boundary independently (table)
Message layerRecordCannot infer
Envelope separatorRaw line and offsetThat it is a message header
Header sectionField names, folding, and parse statusThat a field is unique
Blank lineExact delimiter and line endingThat no body exists
BodyRaw or encoded spanThat text is safe to display
Transfer encodingDeclared encoding and decoderThat bytes are already Unicode
Message IDHeader value and source locationThat it is a unique archive key

Treat MIME boundaries and attachments as nested evidence

RFC 2046 defines multipart bodies with a boundary parameter and delimiter lines. Record the complete Content-Type header, boundary token, nesting path, delimiter offsets, part headers, Content-Disposition, filename parameter, media type, transfer encoding, and decoded byte span. A filename is metadata, not proof of file type, and a MIME part is not necessarily a standalone attachment.

Treat MIME boundaries and attachments as nested evidence (table)
MIME observationSupportsOpen question
Multipart boundaryA candidate part delimiterDoes the closing delimiter exist?
Part headersDeclared media and dispositionDo bytes match the declaration?
FilenameSuggested display nameIs it encoded, duplicated, or unsafe?
Transfer encodingA decode ruleWas decoded content retained separately?
Nested messageAn embedded message partShould it be parsed as a new message?
Attachment mboxPotential nested mailbox payloadCould it intermix with the outer mailbox?

Synthetic message ledger

Treat MIME boundaries and attachments as nested evidence code example, JSON
{"mailbox":"fixture-mbox-01","message":{"separator_offset":"fixture-offset","header_body_split":"fixture-offset","content_type":"multipart/mixed","boundary":"fixture-boundary","parts":[{"path":"1","media_type":"text/plain","transfer_encoding":"fixture-encoding"},{"path":"2","media_type":"application/octet-stream","filename":"fixture.bin","decoded_span":"fixture-span"}]},"state":"metadata-only"}

Reconcile counts and decoded parts without exposing mail

Use a synthetic mailbox to compare separator count, parsed message count, MIME part count, decoded attachment count, and re-encoded output. Capture parser version and recovery events. A successful attachment decode does not prove that the message boundary was correct, that a nested mbox was not intermingled, or that the decoded bytes are safe to open.

Reconcile counts and decoded parts without exposing mail (table)
ReconciliationRecordHold when
Separators to messagesCandidate and accepted countsA separator is malformed or ambiguous
Headers to bodiesOne split per message or recoveryMultiple blank lines change the result
MIME partsOpening and closing delimiter countsNesting is incomplete
Decoded bytesEncoded and decoded lengthsDecoder silently truncates
Re-encoded messageChanged headers and boundariesSource bytes are replaced
Privacy boundaryRedacted field and payload policyReal addresses or bodies enter the report

Stop before message extraction is trustworthy

Stop conditions

  • Stop if the mbox variant, separator policy, line endings, or format parameter is unknown.
  • Stop if body lines beginning with From space could be confused with full separator lines.
  • Stop if RFC 5322 headers and body cannot be separated without parser recovery.
  • Stop if MIME opening or closing boundaries, nested parts, or transfer encoding are incomplete.
  • Stop if an mbox attachment may have been intermingled with the receiving mailbox.
  • Stop before opening decoded attachments when the source contains private or untrusted content.

Pair this worksheet with the data provenance log for export and decoder history and the data card template for collection context. A parsed attachment does not prove message completeness, ownership, privacy clearance, or permission.

For a supported non-health collection, after the owner has authority to describe the scope and a controlled metadata packet, the qualified appraisal request path may be a preparation step. It does not read mail, scan attachments, determine sender identity, create a quote, match a buyer, or grant a license.

Sources

  1. RFC Editor: RFC 4155: The application/mbox Media Type (opens in a new tab)
  2. RFC Editor: RFC 5322: Internet Message Format (opens in a new tab)
  3. RFC Editor: RFC 2046: Multipurpose Internet Mail Extensions (opens in a new tab)

Use the appraisal path after the mbox boundary packet is organized.

It does not read mail, scan attachments, determine sender identity, create a quote, match a buyer, or grant a license.