andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:

I find myself in a situation where I have 4-5 years of (work) email dumped to 6 Microsoft Outlook PST files (some 800MB combined). The objective is to convert all that email into a text format that I can view, search and print from the command line on a Unix like operating system.

The current email service is outsourced (vpnc + rdesktop access), so there is no way I can interact directly with the Exchange server. I _can_ however, open the PST files in Outlook and export it to CSV there, but as Outlook can export one folder (of which I have up to 100 in each file) at the time only, it would be a long-running and error-prone, manual process.

The topic has been discussed here before:

Furthermore, there are several other related projects out there: Does any of the honorable monks have experience with such issues I would appreciate them coming forward.
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]

Replies are listed 'Best First'.
Re: In search for a working Microsoft Outlook PST file converter
by tachyon-II (Chaplain) on Apr 25, 2008 at 09:02 UTC

    Given what you tell us it seems you can export a PST giving you a local copy. You can open this locally using Outlook and your messages are there. If you have not worked out how to open it locally with outlook the trick used to be to rename the current *.PST to PST.OLD with outlook closed. When you fire it up again it complains it can't find the PST and lets you enter the path. I could never find any other way of doing this but it has been years (Outlook 2000 days). Once you have finished reverse the process.

    Given that you can access your PST with Outlook I would suggest simple Win32::OLE automation of your local Outlook. It may not be fast but should do the trick. You can find most of the code you need at Win32 - M$ Outlook and Perl. The code presented does not get the full headers which you might like to keep. You may find this VB example useful as it gets the headers, body, body as html. Headers and body appended to a text file is more or less standard *nix mailbox format.

      Although I would prefer a solution which does not require Microsoft Outlook to be installed locally, I think you are right in that it's probably the way to go. I located a Win32 laptop with ActiveState perl and was able to dump the contents of the root Inbox folder using the code samples from this node as suggested.

      Some minor questions needs to be resolved (such as how to decend into the directory hierarchy of email folders?), but it basically works. Thanks.

      --
      No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
        See this code example. I had been meaning to get around to this for a while. Your question triggered the to-its to get round to the do-its

        tuits->duits Migration from Outlook to any other mail program aka how to leverage Outlook as a working PST file converter

Re: In search for a working Microsoft Outlook PST file converter
by tmaly (Monk) on Apr 25, 2008 at 14:35 UTC
    I recently had to do something like this with Win32::OLE on Outlook 2003. I wrote up a little code on my site a few weeks back if it is any help. I ended up having to access a different PST file then the default so this might be helpful. You will also need to install Outlook Redemption because MS added some new security feature which would force you to click a box every time you accessed email. Here is the link to my writeup http://www.tysonmaly.com/2008/03/26/parsing-outlook-emails-in-a-pst-file-with-perl-on-windows-xp/