Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Reading an Outlook PST FIle

by BaldPenguin (Friar)
on Jun 13, 2005 at 05:39 UTC ( #466065=perlquestion: print w/replies, xml ) Need Help??
BaldPenguin has asked for the wisdom of the Perl Monks concerning the following question:

My Fellow Monks:

Here is my quandry. I use Spamassassin to filter the mail on my mail server, a mail server that hosts more that just my mail. It works quite well. But those wiley spammers are good at hiding their spam from the likes of SA. I want to use the sa-learn to start teaching my bayesian filter what gets missed. Using outlook, I can automatically mark items as junk, which does it's own learning in outlook. Wanting to share this education with everyone else using the mail server, I would like to create a PERL script that reads my 'Junk Mail' folder in the Outlook PST file and runs those mails against the sa-learn binary.

Has anyone done that before, a quick search on CPAN didn't find anything, likewise my searching skills found minimal solutions here within the monestary.

Any pointers?


Replies are listed 'Best First'.
Re: Reading an Outlook PST FIle
by tachyon (Chancellor) on Jun 13, 2005 at 06:56 UTC

    I would suggest this ready rolled, free, with source code, (non Perl) solution: Personal Message Store (PST) Export Utility 1.0. You can export a PST of just the junk mail folder from outlook with File|Export|etc beforehand to separate out the junk.

    This gives you the original full headers (probably), newline separated ie in standard *nix format.



Re: Reading an Outlook PST FIle
by monarch (Priest) on Jun 13, 2005 at 07:04 UTC

    Just looking on the 'net I found this link which basically says that the .pst file format is protected, and accessing the files through OLE might be the way to go (with a running instance of Microsoft Outlook).

    A perl FAQ (How do I create a new folder in Outlook?) may be a stepping stone..

      accessing the files through OLE might be the way to go
      This question just came up again on the Chatterbox, and looking through CPAN I found a module (by Barbie): Mail::Outlook, which apparently is built on top of Win32::OLE. So you no longer have to start from zero.
Re: Reading an Outlook PST FIle
by rob_au (Abbot) on Jun 13, 2005 at 10:08 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://466065]
Approved by monkfan
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2017-12-17 03:29 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (462 votes). Check out past polls.