Does anyone know if it is possible to extract the SMTP headers from messages
in Exchange using Win32::OLE (or other means). For example, I would like to
extract the /X-MailScanner.*/ headers from messages in a certain folder (see
below).

8< -------- cut here -------- >8

use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Outlook';

$Win32::OLE::Warn=2;

my $outlook = Win32::OLE->new('Outlook.Application', undef);
my $ol = Win32::OLE::Const->Load($outlook);

my $namespace = $outlook->GetNamespace("MAPI");
my $folder = $namespace->GetDefaultFolder(olFolderInbox);
my $root = $folder->Parent();
my $spam_folder=$root->Folders("Probable Spam");
for my $item (in $spam_folder->Items()) {
        # extract header fields matches /^X-MailScanner/
}

8< -------- cut here -------- >8

If one has to name the fields (e.g. X-MailScanner-SpamCheck), then I can
live with that.

Bret
--
Bret Giddings, Systems Manager, Computing Service, University of Essex
Tel: (01206) 872577     Email: [EMAIL PROTECTED]      Fax: (01206) 860585

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to