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

Format:Thunderbird MSF (Mork)

From ReverseEngineering.wiki
Format
Magic 2F 2F 20 3C 21 2D 2D 20 3C 6D 64 62 3A 6D 6F 72 6B (slash-slash comment containing mdb:mork:z)
Extensions .msf
On this wiki Facts · Code · Notes · Topics

Thunderbird's per-folder summary file (.msf) in the Mork text format: a first line that is a slash-slash comment wrapping the tag mdb:mork:z v="1.4", key and value dictionaries, and rows of hexadecimal-id cells; a rebuildable cache of message headers and flags, not the mail itself.

An MSF (Mail Summary File) is Thunderbird's per-folder message database, named like the folder plus .msf (INBOX.msf). It uses Mozilla's historical Mork text format. The notes are from the specification written in the MIT-licensed repository monperrus/thunderbird-msf-python (specification-MSF.md), which cites Thunderbird's MorkParser.sys.mjs and nsMsgHdr.cpp; the Thunderbird sources themselves were not read, so details are as that document states them.

Identification

The file starts with a line comment that wraps an HTML-style comment around the tag <mdb:mork:z v="1.4"/> (the exact bytes are in the magic fact: // then the comment opener, a space, the tag, and the closer). It is plain text (declared source encoding usually iso-8859-1), with // comment lines, backslash-newline continuation, a doubled backslash for a literal backslash, backslash-parenthesis for a literal closing parenthesis and $HH byte escapes (consecutive ones decoded as UTF-8 with an ISO-8859-1 fallback; $00 dropped).

Data model

  • Key atoms: (81=subject) maps hex id 81 to a column name; value atoms map hex ids to strings. Dictionaries are in angle-bracket blocks; <(a=c)> marks a key dictionary.
  • Cell: (^C3=literal) or (^C3^273A) (column atom, then inline value or value atom reference).
  • Row: [4(^81^2733)(^82^2732)], a hex row id then cells. Table: {1:^80 ... }. Later cells for the same row id update it; [-5(...)] clears and replaces row 5. A reader must process the stream in order and must not split on ) or ].
  • Scopes: message rows ns:msg:db:row:scope:msgs:all, thread rows ns:msg:db:row:scope:threads:all, folder info ns:msg:db:row:scope:dbfolderinfo:all.

Useful columns

subject, sender, recipients, message-id, date and dateReceived (hex Unix seconds), flags (hex bit mask: 0x1 read, 0x2 replied, 0x4 flagged, 0x8 expunged, 0x10000 new, 0x10000000 has attachment), keywords, storeToken, gloda-id.

storeToken locates the message in the real store: for Format:Maildir it is the file name in cur/ including the flags suffix; for Format:Mbox it is the byte offset as a decimal string. The MSF holds no full bodies and may be deleted: Thunderbird rebuilds it (a maildirValid folder property of false forces a rebuild).

Newer Thunderbird storage

Unverified: Thunderbird's global search index (Gloda) keeps a SQLite database global-messages-db.sqlite in the profile; it can be recognised as Format:SQLite database file by its magic. Not read in a source here; check by opening a profile copy read-only.

See Technique:Identifying mail and message stores.

Code & repositories

  • https://github.com/monperrus/thunderbird-msf-python @ f58cb570031c12411a65316d043981bdc882ca5b · license: MIT (declared by the contributor for the files used; GitHub reports MIT (read from LICENSE; GitHub's API was busy) for the repository)
    MIT-licensed Python reader plus specification-MSF.md documenting Thunderbird's Mork-based .msf summary files: lexical rules, row accumulation, columns, flags and Maildir storeToken.
    Tested on: source read, not run: specification read, not run · checked 2026-10-19