in reply to UNIX Mail Box and Mail Parsing

Hi draconis

Have you tried Mail::MboxParser ?

Here is the sample code from the module

my $mb = Mail::MboxParser->new('some_mailbox', decode => 'ALL'); # ----------- # slurping for my $msg ($mb->get_messages) { print $msg->header->{subject}, "\n"; $msg->store_all_attachments('/tmp'); } # iterating while (my $msg = $mb->next_message) { print $msg->header->{subject}, "\n"; # ... }
artist

Replies are listed 'Best First'.
Re: Re: UNIX Mail Box and Mail Parsing
by draconis (Scribe) on May 21, 2003 at 21:13 UTC
    I did look at that; however, I need to be able to delete the mail after it is processed. From what I understand - Mail::MboxParser is read-only to the mailbox.

    Am I mistaken?

      Okay !

      I can use this - it's read only but so what ! I can FLOCK the file before I do anything, extract the attachments, unlink the file and then remove the FLOCK.

      Thanks !