On Tuesday 25 September 2007 15:46, Dan Shearer wrote:
> As Julien said, this feels well out of scope for libmapi utils. libmapi
> isn't trying to provide an Outlook interop kit.

> > However, there is something interesting here. 
> A set of Outlook-related utilities that worked with OpenChange utilities
> would be useful to many.
While I agree it doesn't really feel like part of libmapi or the OpenChange 
server, there still might be some overlap. For example, the tags appear to be 
similar (or perhaps to be the same) in .pst, .msg and MAPI RPC. The code that 
handles those could be made common/ abstracted out.

If we had the developers, it might be worth doing it as part of OpenChange. 
That is a pretty big "if" though.

> For example, a utility that can read mapidump data and generate MSG or
> PST.  In the realm of all-the-pieces-are-functional-today consider
> libpst (http://alioth.debian.org/docman/view.php/30390/47/readpst.1.html
> ) which could be used to read a pst file and then upload it to a mailbox
> on an Exchange server.
It might be possible to build some common code out of libpst 
(http://www.five-ten-sg.com/libpst/ which is a fork/update of the same 
codebase that went into readpst), and OLE library (e.g. Apache POI, as 
pointed out by Dan, or perhaps libgsf).

From http://www.fileformat.info/format/outlookmsg:

Outlook MSG file format
---------------------------------------------
Date: 31.03.2003
Email: peter.fiskerstrand [at] netcom.no
Feel free to send me comments about this doc.
---------------------------------------------

MSG files are outlook messages saved as files.
They are saved as "COM stuctured storage OLE2 compound documents" or 
"DocFile", which is the same technique used by Word, Excel and many many 
more.

To view the contents of a "DocFile", you can use DFVIEW.EXE (shipped with MS 
Visual C++ 6.0).
Or you can decode it yourself. This text does not help you to do that, but 
assumes you already know about compound files. More info at 
http://www.wotsit.org

If you open a .msg file you will see many streams. Here's an example:

__nameid_version1.0
        __substg1.0_00020102
        __substg1.0_00030102
        __substg1.0_00040102
        __substg1.0_10100102
__substg1.0_001A001E
__substg1.0_0037001E
__substg1.0_10090102
__substg1.0_3FF8001E
__substg1.0_3FF90102
__properties_version1.0
__recip_version1.0_#00000000
        ...
__attach_version1.0_#00000000
        ...
__attach_version1.0_#00000001
        ...

Nameid, recip and attach are "folders" which contain substgs.
Properties contains some binary data.

Attach contains an attachment (a file, a picture, a new mail message etc.).
Recip contains information about a recipient.
The #00000000 is just the count. If you have five attachments, they are 
numbered 0-4.

Each substg contains a piece of information. The first four of the eight 
digits at the end tells you what kind of information this is. (Property). The 
last four digits tells you the type (binary, ascii, unicode etc.)

If you open a substg that has 001E at the end, you wil see plain ascii text 
inside.
0102 means binary information. There are other types, but they are rarely 
used.

Back to the first four digits, the property types:

001A means Message Class. It can contain one of the following:
        IPM.Note                <- a regular e-mail
        IPM.Contact             <- a contact (name, address, phone etc.)
        IPM.Post                <- a post-it note
        IPM.Activity            <- a calendar event
        IPM.Task                <- a task

        or special cases like:
        IPM.Note.Rules.OofTemplate.Microsoft
        IPM.TaskRequest.Accept

Attachment: pgp2j6vso8L9a.pgp
Description: PGP signature

_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to