Reading Outlook .msg file using Python

John Henry john106henry at hotmail.com
Fri Oct 22 12:55:16 EDT 2010


On Oct 21, 1:48 am, Tim Golden <m... at timgolden.me.uk> wrote:
> On 21/10/2010 09:34, Jon Clements wrote:
>
> > Only just noticed this thread, and had something similar. I took the
> > following approach:-
>
> > (I'm thinking this might be relevant as you mentioned checking whether
> > your client'sOutlookcould export .EML directly, which indicates (to
> > me at least) that you have some control over that...)
>
> > - Set up an IMAP email server on a machine (in this case linux and
> > dovecot)
> > - Got client to set up a new account inOutlookfor the new server
> > - Got client to use theOutlookinterface to copy relevant emails (or
> > the whole lot) to new server
> > - Used the standard imaplib and related modules to do what was needed
>
> Nice lateral approach. It would also be possible to do this same
> kind of thing via the native Microsoft toolset alone if the OP
> has access to the appropriateOutlook/ Exchange accounts. (Indeed,
> Exchange itself can act as an IMAP server which might be another
> approach). I confess I was starting from the original "Can I read an
> .msg file?" question.
>
> TJG

Found some useful information:

http://www.fileformat.info/format/outlookmsg/index.htm

At least it takes some mystery out of the msg file.  It explains why
my attempt to read the msg file fails sometimes.  It appears some
messages don't have a header info (or at least not in the format as
described).  I need to keep trying and see how I can get the header
info.



More information about the Python-list mailing list