Good Afternoon Fine Monks,

I am forced to use Oulook 2000 at work. I suddenly started receiving a TON of SPAM and my administrator told me to send him the message headers from the spam so that he could get the Return-Path out of it and use it to bounce the offending email at the server level.

Not wanting to waste a bunch of time, I decided to write a short program to interact with my Outlook and extract the info I needed. I have it done (see below), but I am not able to get the return path, because I don't have the right constant. The closest thing I have found is ReplyRecipientNames. I have checked out the M$ Outlook 9.0 Object Library which is on my machine from the ActiveState install at D:\Perl\html\OLE-Browser\Browser.html, but I haven't found what I need.

I need the Return-Path or the entire message header so I can parse it out myself. Any insight out there?

#!C:/perl/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; $|=1; $Win32::OLE::Warn = 3; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') or Wi +n32::OLE->new('Outlook. +Application', 'Quit'); my $ol = Win32::OLE::Const->Load($Outlook); my $namespace = $Outlook->GetNameSpace("MAPI") or die "Can't open MAPI + namespace: $!"; my $Folder1 = $namespace->GetDefaultFolder(olFolderInbox); my $Folder2 = $Folder1->Folders("TEST"); foreach my $item (in $Folder2->{Items}){ print $item->{'ReplyRecipientNames'} . "\n"; } exit 0;

Any help is MUCH appeciated.

Update: Changed $|++ to $|=1.

bassplayer


In reply to Win32::OLE Outlook help requested by bassplayer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.