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

[Sheflug] Re: SpamAssassin problems.



Baz

Tried your script and it bombed out at line 17....



#!/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();
    $mail->accept( "/home/richard/Spam" );  #Line 17 - this is it
} else {
    $mail->accept( $mailbox );
}


The error message was...

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 ?

Thanks





Richard
___________________________________________________________________

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

  GNU the choice of a complete generation.