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

I receive a piece of email notice every time when someone check in some file to cvs repository. I am supposed to check and see whether the right things are done. However the email notice does not contain enough information, for example, such things as tag is missing.

I am thinking of create a script that will retrieve message from my personal folder (all cvs related emails are automatically forwarded to a folder called cvs), then I can get tags and other informations through some sort of cvs interface.

I did an online search. A module called CVS came up, I quickly went through its doc, and looks fine to me. As I never used this modle before, I am not sure whether that's a good module, or is there any better choices.

I searched the word 'outlook' on CPAN, two of the modules returned seem useful to me: Mail::Box::Dbx, and Mail::Transport::Dbx. But the doc says that they were for outlook express, I am not sure whether that covers outlook.


  • Comment on read emails in outlook personal folders

Replies are listed 'Best First'.
Re: read emails in outlook personal folders
by Solo (Deacon) on May 27, 2004 at 15:19 UTC
    OLE sounds like the easiest option for a script that will run from your computer. You will run into security/logon concerns if you try to put this on a server somewhere.

    use Win32::OLE qw(in); my $Outlook = Win32::OLE->GetObject("Outlook.Application") || Win32::OLE->new("Outlook.Application"); my $Session = $Outlook->Session; for my $Folder (in $Session->Folders) { next unless $Folder->{Name} =~ /Personal Folders/; for my $SubFolder (in $Folder->Folders) { next unless $SubFolder->{Name} =~ /Code Eval/; for my $Item (in $SubFolder->Items) { print $Item->{Subject} . "\n"; print $Item->{Body} . "\n\n"; } } }

    This was taken from code I wrote a few years ago. I can't remember if it's important that I used regexps to match folder names instead of string comparisons.

    Update: minor code tweaks

    Hey, don't worry. Chewie and me got into a lot of places more heavily guarded than this.
Re: read emails in outlook personal folders
by chanio (Priest) on May 28, 2004 at 03:52 UTC
    There is an alternative way of doing it by downloading your emails via a proxy when you ask for them from Outlook. So you can read the emails before Outlook takes care of it. is a very well developed perl spam filter. Reading it is like going to school.

    It sits in between your isp email accounts and Outlook or any other email agent (using a proxy port).

    It allows anybody to add a module if it follows their clear rules. Read the wiki where it explains those rules. Besides, perhaps you could take advantage of the Bayasian filter to detect the emails that you need to copy to another place.

    Installing it in Windows is an example of a good perl 2 exe translation.

    _`(___)' __________________________
Re: read emails in outlook personal folders
by perrin (Chancellor) on May 27, 2004 at 16:13 UTC
    If your CVS folder is on the server, you can probably access it via IMAP. You just have to talk nice to your admins to get them to give you the IMAP address.

      If, on the other hand, you want to search the PST (personal folders) file on your hard disk, I know of no utility to do so. The PST contains a lot more than just email and is definitely different from an OLE mail file...

      If this is the case, you probably have to set up something to suck out the CVS files via IMAP or POP (possibly leaving them on the server so you can later get them into your Outlook personal folders). The problem comes if you generally have Outlook open, because it would likely snag those emails before your script got to look at them. (Personally, I keep Outlook closed and use a POP-polling applet to tell me if I have anything in there. In that case, the only problem is mail that arrives while you're reading mail.)

        There used to be a utility called LibPST (ol2mbox pr libpst) which reads PST files... you could always adapt the source code and submit a new module to CPAN :-)