Format:Outlook MSG
| Magic | D0 CF 11 E0 A1 B1 1A E1 (Compound File Binary) |
|---|---|
| Extensions | .msg |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Outlook .msg: a single message stored as a Compound File Binary whose streams are named __substg1.0_<property id><type> and whose properties header is __properties_version1.0, with sub-storages for recipients, attachments and embedded messages ([MS-OXMSG]).
An Outlook .msg file is a Format:Compound File Binary (magic D0 CF 11 E0 A1 B1 1A E1) laid out according to the open specification [MS-OXMSG]. The notes below were read in the Python package extract_msg (GPL-3.0; extract_msg/msg_classes/msg.py, extract_msg/properties/properties_store.py, extract_msg/constants/st.py) and are limited to what that code shows. Anything else is marked Unverified.
Identification
- Compound file magic, then the root storage holds
__properties_version1.0and streams named__substg1.0_XXXXYYYY. The root entry CLSID is Unverified (the Outlook message class id 00020D0B-0000-0000-C000-000000000046 is the value generally cited; check with an unpack of the directory). - Outlook-shaped compound files without a PST are therefore recognised by those stream names. Contrast with Format:Outlook PST and OST (PFF), which is not a compound file.
Property streams
A variable-length property lives in its own stream called __substg1.0_ followed by 8 hex digits: the 4-digit property id then the 4-digit property type. extract_msg looks for '__substg1.0_' + id + type and also searches by id alone, since the type may vary. Examples used by the code: __substg1.0_001A (message class, read as a string stream) and __substg1.0_3001 (attachment display name). Type codes that appear in extract_msg's constants include 0x001E (8-bit string, code page text), 0x001F (UTF-16LE string), 0x0102 (binary), 0x000D (object, used for embedded messages), 0x0003 (32-bit integer), 0x000B (boolean), 0x0040 (time). Which code means which string width is standard MAPI; the correspondence with 001E and 001F is Unverified in this source read.
The properties stream
The stream __properties_version1.0 holds the fixed-size values (and the type, id and flags of every property, including those stored in streams) are in the __properties_version1.0 stream: a header followed by 16-byte entries. extract_msg's property store skips a header of 32 bytes for a top-level message, 24 bytes for an embedded message and 8 bytes for attachment and recipient property streams, then splits the rest into 16-byte entries. Each entry is unpacked as <2HI (a 16-bit type, a 16-bit id, 32-bit flags) followed by 8 bytes of value. For message headers the 8 reserved bytes are followed by four 32-bit counters: next recipient id, next attachment id, recipient count, attachment count.
Sub-storages
- Attachments: storages whose names start with
__attach(the code only tests the prefix). The full name pattern__attach_version1.0_#followed by 8 hex digits is Unverified here. - Recipients:
__recip_version1.0_#plus 8 hex digits (Unverified here; seen in [MS-OXMSG]). - Embedded messages: an attachment storage can contain a complete message with its own properties; that is the 24-byte header case above, and the nested message uses the same stream names under that storage's prefix.
- Named properties are mapped through a
__nameid_version1.0storage (Unverified here).
Tools
extract_msg (Python, GPL-3.0) unpacks bodies, recipients and attachments; Outlook itself creates .msg files by Save As.
Code & repositories
- https://github.com/TeamMsgExtractor/msg-extractor @
18172ea4730fcfef6edaa0bd20e7a9c64bea20b9· license: GPL-3.0
Python package extract_msg that reads Outlook .msg files: stream names, property store header sizes and the 16-byte property entry struct are in msg_classes/msg.py, properties/properties_store.py and constants/st.py.
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-09