[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sheflug] SpamAssassin problems. Was: (no subject)
>>>>> "Barrie" == Barrie Bremner <baz-sheflug [at] barriebremner.com> writes:
Barrie> Is that the whole script?
Barrie> This line:
Barrie> next unless $from =~ /$_/i or $to =~ /$_/i;
Barrie> Suggests you want to loop over a number of patterns and
Barrie> match the From:/To: headers against those strings.
Just to clarify this one...normally, in SpamAssassin/Mail audit
scripts you'll see something like (from my own script):
my %p6_lists = ( "perl6-internals" => "perl6-int-dump",
"perl6-language" => "perl6-lang-dump",
"perl6-announce" => "perl6-ann-dump",
);
foreach my $pattern (keys %p6_lists) {
if ( $mail->to =~ /$pattern/i
or $mail->get('List-Post') =~ /$pattern/i
) {
$mail->accept($maildir.$p6_lists{$pattern});
}
}
What you've got is inside a while loop. Each line of the input is
aliased to $_, so your pattern is trying to match the To: and From:
headers to the whole line currently being read from <DATA>, ignoring
case.
As I mentioned, the message is on STDIN, so that while (<DATA>) {...}
might not even be executed, and even if it was, it doesn't look right.
Cheers.
Baz.
--
Barrie J. Bremner
baz-sheflug [at] barriebremner.com http://barriebremner.com/
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.