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

Hi all, Is there a script out there that will do pattern recognition and copy a series of messages from a mailbox (the kind PINE uses) based on Subject, or Recipient and save them off to a text file? Thanks Xao
  • Comment on Program to strip message from sendmail-style mailbox

Replies are listed 'Best First'.
(ar0n: use Mail::Procmail) Re: Program to strip message from sendmail-style mailbox
by ar0n (Priest) on Aug 10, 2000 at 03:11 UTC
    Actually, a fellow dutchman (Johan Vromans) just released a module called Mail::Procmail (look at CPAN), which filters mail and does stuff with it.

    update: the documentation is here, and the tar.gz is here.

    -- ar0n || Just Another Perl Joe

      Actually, I was looking for a sort of standalone perl file that would go through and extract those messages so I can send them off to someone else or archive them. This would be for a mailfile that already exists not for incoming mail.
Re: Program to strip message from sendmail-style mailbox
by KM (Priest) on Aug 10, 2000 at 17:39 UTC
    Take a look at Mail::Audit as well to do filtering. There is also an article on it in TPJ #18.

    Cheers,
    KM