This is a mirror of official site: http://jasper-net.blogspot.com/

MSG File Format, Rights Managed Email Message

| Monday, June 21, 2010
In my previous two blog entries, I’ve focused on becoming familiar with the Compound File Binary Format which we discovered was similar to a FAT file system within a file.  With that exercise behind us we’re ready to step up a level in the ecology of file formats.  Analogous to ascending from chemistry to simple cell organisms, CFBF has given us the building blocks with which the great variety of application file formats are assembled.

Recently, I took the time to expand my view of application formats by investigating the workings of Outlook’s .msg format.  Specifically, I was required to explain how a Rights Managed Email message could be dissected in order to read the contents hidden within.  Having only a cursory knowledge of the Outlook message file format (.msg), and that being based of course, on CFBF, I needed only to discover where the critical components of the email message could be found.  I will divide this blog into two parts.  In part 1, I will overview the message file format described in MS-OXMSG in preparation for part 2.  In part 2, I will describe in some detail, including code fragments how to find the compressed email attachment in a rights managed email and how it can be decompressed in order to read it plainly.

.MSG
In this overview section, my goal is to describe the message store structure in a way that will enable you, the reader to recognize quickly the storages and streams in a sample .msg file and understand what you’re seeing.  As always, to get the nitty-gritty detail of property names and fields sizes and the like, please refer to the actual documents that I’ll list as we navigate them.

A .msg file can be saved in Outlook or compatible email client and then viewed in an hex editor or binary file parser like OffViz or 010.  MS-OXMSG tells us that a .msg file is a CFBF that contains storages and streams.  However, imposed on the organic building blocks is a greater scheme.  Message files contain objects which contain properties and collections of properties.   For all intents and purposes, objects are represented by storages (CFBF), and properties are represented and reside in streams (also CFBF; remember that since a .msg file is a CFBF, *everything* must fall into a storage or stream.

Objects
Objects in a message store can be created by an email client (Outlook or compatible client) or the server (Exchange or compatible mail server).   There are three basic types of objects you’ll find in a .msg storage structure.  One is the email “object” represented by the .msg compound file itself.  There is only one of these objects at the top level or root but there can be more email objects at lower levels, contained within the other two object types.   The other two object types are the Recipient object and the Attachment object.

Read more: Microsoft Open Specification Support Team Blog Part 1, Part 2

Posted via email from .NET Info

0 comments: