[SlugBug] Using Mail::Audit to /dev/null mail

Neil McGovern maulkin at halon.org.uk
Wed Apr 28 19:19:27 BST 2004


On Tue, Apr 27, 2004 at 02:55:58PM +0100, Alan Dawson wrote:
> Hi, I've been looking at
> 
> http://wiki.slugbug.org.uk/Mail::Audit
> 
> Now I was wondering if it could be used to /dev/null mail for a mailman list.
> 

Ello,

What you prolly want is something like this:

# Load the SpamAssassin module
use Mail::SpamAssassin;

# Check for spam
my $spamass = new Mail::SpamAssassin;
my $spamstatus = $spamass->check($mail);

# Rewrite mail with SpamAssassin headers
$spamstatus->rewrite_mail();

# Some more of your script

foreach ($mail->get("To")) { # or whatever header you want to filter
                             # with
        chomp;
	if ($spamstatus->is_spam()) {
		$mail->ignore;
	}
	$mail->accept($path); # or just pipe it to mailman.
}


HTH,
Neil
-- 
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?
gpg key - http://www.halon.org.uk/pubkey.txt ; the.earth.li B345BDD3


More information about the SlugBug mailing list