#!/usr/bin/perl use Email::Filter; use strict; use warnings; no warnings 'uninitialized'; my $home = "/home/users/sderle/mail"; my $mail = Email::Filter->new; $mail->exit(0); $mail->simple(Email::Simple->new($mail->pipe("/usr/bin/spamc"))); $mail->exit(1); $mail->reject if $mail->header("X-Spam-Flag") =~ /YES/o; $mail->reject if $mail->header("X-Spam-Level") =~ /\*{4}/o; $mail->reject if $mail->from =~ /Mail Delivery Subsystem|MAILER-DAEMON|postmaster|automated-response/io and $mail->to !~ /schuyler|sderle/io; $mail->reject if ($mail->from =~ // and $mail->header("RT-Originator") !~ /\@oreilly\.com$/ ); $mail->reject if $mail->from =~ /\.java\.net/io; $mail->accept("$home/cron") if $mail->from =~ /Cron Daemon|User for OPG/io or $mail->subject =~ /^cron: /o; $mail->accept;