Introduction
An .msg file is a single item saved from
Microsoft Outlook on
Windows: usually an email, but it can also be a meeting request, a contact or a task.
It is what Outlook writes when a message is dragged out to a folder or saved with
“Save As”. Unlike an EML file, which holds the message
as it was sent, an .msg file holds Outlook’s own list of the item’s
properties, so it keeps details such as flags and categories.
Microsoft publishes the format as [MS-OXMSG] in its Open Specifications.
Structure
The file is a Compound File Binary file, the same container as old Word and Excel
files, so it starts with D0 CF 11 E0 A1 B1 1A E1. Inside are storages and
streams, like folders and files:
__properties_version1.0: a table of the item’s fixed-size properties, such as flags, dates and sizes__substg1.0_XXXXYYYY: one stream per variable-size property, whereXXXXis the property ID andYYYYits type in hexadecimal; for example__substg1.0_0037001Fis the subject as UTF-16 text__recip_version1.0_#00000000and so on: one storage per recipient__attach_version1.0_#00000000and so on: one storage per attachment, which can hold another whole message__nameid_version1.0: the mapping for named properties
The body may be stored as plain text, as HTML, or as compressed RTF, often more than one of these.
Links
Software
- Microsoft Outlook (Windows)
Developers
- extract-msg, Python package for reading
.msgfiles - MSGReader, .NET library for reading
.msgfiles
Reference
- [MS-OXMSG]: Outlook Item (.msg) File Format, Microsoft Open Specifications