Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

perl library for mail filtering

tag: 2.218

Fetching latest commit…

Cannot retrieve the latest commit at this time

This is what Mail::Audit is all about:

        Mail::Audit - Library for creating easy mail filters

        use Mail::Audit;
        my $mail = Mail::Audit->new;
        $mail->pipe("listgate p5p") if ($mail->from =~ /perl5-porters/);
        $mail->accept("perl) if ($mail->from =~ /perl/);
        $mail->reject("We do not accept spam") if looks_like_spam($mail);
        $mail->ignore if $mail->subject =~ /boring/i;


        procmail is nasty. It has a tortuous and complicated recipe
    format, and I don't like it. I wanted something flexible whereby I could 
    filter my mail using Perl tests.

    `Mail::Audit' was inspired by Tom Christiansen's audit_mail and
    deliverlib programs. It allows a piece of email to be logged, examined,
    accepted into a mailbox, filtered, resent elsewhere, rejected, and so
    on. It's designed to allow you to easily create filter programs to stick
    in a .forward file or similar.


Why should you use popread? POP3 mailboxes can collect lots of messages,
which you then download, all at once. And every time your local delivery
agent tries to deliver each message through your .forward or .qmail, it
has to fork off a new copy of Perl, which has to load up Mail::Audit and
its dependent modules, and so on. When you're downloading 100 messages,
this can drive your load average through the roof. 

popread takes care of POP access, filtering and local delivery all in
one process, which is much faster and more efficient. Oh, and it deletes
duplicate mail from the POP3 server, so you're not downloading the same
message over and over again (Think a message to a mailing list, Cc'd to
you) saving you bandwidth too. 

You don't have to use popread, but if you do, it requires the
Mail::POP3Client module from CPAN. Remember to add your filter code to
it, and set up your POP3 accounts, before attempting to run the program.


This is a very early version of a program which automatically converts
your legacy procmail rc files into Mail::Audit filters. Don't expect it
to work flawlessly on complex rcs. If you want to use it, you need the
Parse::RecDescent module from CPAN.


I heartily welcome bug fixes, suggestions and patches to Mail::Audit.
Please mail them to me at Also, please feel free to mail
me if you'd like to informed about future versions of Mail::Audit, or if
you have any problems with the module.

Something went wrong with that request. Please try again.