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

Re: [Sheflug] Re: SpamAssassin problems.



On Sat, May 17, 2003 at 11:30:11AM +0100, Richard Ibbotson wrote:
> May 17 10:54:10 postfix/local[11816]: 1BCE8460F7:
> to=<richard [at] localhost>, relay=local, delay=0, status=bo
> unced (Command died with status 255: "IFS=' ' && exec
> /home/richard/.spam -f- || exit 75 #richard". Command output: Global
> symbol "$mail" requires explicit package name at /home/richard/.spam
> line 17. Global symbol. Execution of /home/richard/.spam
> aborted due to compilation errors. )
> So, the $mail part of it may or may not be wrong ?

The $mail bit is wrong, yes. It should be $item all the way through.

#!/usr/bin/perl
 
use strict;
use warnings;
 
use Mail::Audit;
use Mail::SpamAssassin;

my $mailbox = "/home/richard/inbox"; # Why not $ENV{'MAIL'} ?

my $item     = Mail::Audit->new( nomime => 1, );
my $spamtest = Mail::SpamAssassin->new();
my $status   = $spamtest->check( $item );   # not $mail.
 
if ( $status->is_spam() ) {
    $status->rewrite_mail();
    $item->accept( "/home/richard/Spam" );
} else {
    $item->accept( $mailbox );
}

For anyone who's interested, my Mail::Audit filter program is available at
http://www.crustynet.org.uk/~chrisb/filter

-- 
Chris
http://crispygoth.livejournal.com/
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.