Walt Mankowski on Fri, 14 Jul 2000 21:04:00 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] procmail filtering this list


On Fri, Jul 14, 2000 at 04:13:48PM -0400, William H. Magill wrote:
> Procmail is truly worse than perl for allowing you to mess yourself up
> multiple ways...

Which is exactly why we should forget about procmail and filter our
mail using Perl's Mail::Audit module... :-)

#!/usr/bin/perl
use Mail::Audit;
my $item = Mail::Audit->new;

# Bounce spam back to sender
if ($item->subject =~ /make.*money.*fast/i) {
    $item->reject;
}

# Throw away mail from Microsoft
if ($item->from =~ /\@.*microsoft\.com/) {
    $item->pipe('/dev/null');
}

# Save PLUG mail in its own folder
if ($item->get('X-BeenThere') eq 'plug@lists.phillylinux.org') {
    $item->accept("/home/waltman/Mail/plug")
}

# Everything else goes to /var/spool/mail/waltman
$item->accept;

______________________________________________________________________
Philadelphia Linux Users Group       -       http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion   -   http://lists.phillylinux.org/mail/listinfo/plug