Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://466065]
Approved by monkfan
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2023-12-07 16:26 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (33 votes). Check out past polls.