in reply to Perl to open embedded email?
That will print the message id number and sender for each message. To deal with attachments, you want to look into $msg->parts. Note that a "folder" here is actually a single file.#!/usr/bin/perl -w use strict; use Mail::Box::Manager; my $mgr = new Mail::Box::Manager; my $box = $mgr->open(folder=>"/you/mail/somebox"); my $c = 0; while (my $msg = $box->message($c)) { my @sender = $msg->from; my $id = $msg->messageId; print "\n$id\n$sender[0][0]\n"; $c++; }
|
|---|