Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Technique:Identifying mail and message stores

From ReverseEngineering.wiki
Technique
On this wiki Facts · Code · Notes · Topics

How to tell which mail or message store a file or folder is (PST/OST, MSG, EML, mbox, MMDF, Maildir, Thunderbird MSF, SQLite-based stores) from magic bytes, names and layout, with links to the format pages.

Client-side mail data comes in a few families. Check the first bytes and the directory layout before anything else.

Store How to recognise it Page
Outlook PST, OST, PAB 21 42 44 4E (!BDN) at 0, content type SM/SO/AB at 8, data version at 10 (14/15 ANSI, 23 Unicode, 36 Unicode 4k pages); encryption byte 0/1/2 Format:Outlook PST and OST (PFF)
Outlook MSG Compound file (D0 CF 11 E0 A1 B1 1A E1) containing __properties_version1.0 and __substg1.0_* streams Format:Outlook MSG, Format:Compound File Binary
mbox text file whose first line begins From Format:Mbox
MMDF first line is four 0x01 bytes Format:Mbox
Maildir directory with cur, new, tmp; files named ...:2,FRS Format:Maildir
Thunderbird .msf first line starts with two slashes and the tag mdb:mork:z Format:Thunderbird MSF (Mork)
SQLite-backed stores SQLite format 3 magic Format:SQLite database file

Single messages (EML and MIME)

Unverified (general knowledge of RFC 5322 and RFC 2045, not read in a source for this page): an .eml file is one RFC 5322 message, CRLF-separated header fields (Received, From, Date, Message-ID, MIME-Version, Content-Type), a blank line, then the body. A multipart/* Content-Type carries a boundary= parameter; parts are separated by lines --boundary and the end is --boundary--. Content-Transfer-Encoding is 7bit, 8bit, binary, quoted-printable or base64. Header words can be encoded as =?charset?B?...?=. Check against a fictional sample before relying on any of it.

Pitfalls

  • A client index (Thunderbird .msf, Outlook OST) is a cache; the content is in the primary store or on the server.
  • Encryption type in PST is a fixed substitution, see the PFF page; a mail store with a real password or key is out of scope here.
  • Treat all samples as private data: do not publish real addresses or messages.