[Mimedefang] Adding bayes_score fromMail::SpamAssassin:EvalTests
Brett Simpson
Simpsonb at hillsboroughcounty.org
Tue Dec 16 16:16:48 EST 2003
Thanks. That definately helped.
Brett
>>> kelson at speed.net 12/16/03 03:42PM >>>
At 11:59 AM 12/16/2003, Brett Simpson wrote:
>Here's what I did but I get an error.
>
> if ($names ne /BAYES_99/) {
> $bayes_score = $1;
Two problems. First, you're mixing regular expression syntax and literal
comparisons on the first line. You want to use =~ or !~ instead of
ne. Secondly, you're not matching anything (something needs to be in
parentheses), so there's nothing in $1 to assign to $bayes_score.
Try something like this:
if ($names =~ /\bBAYES_([0-9][0-9])\b/ && $1 ne '99') {
$bayes_score = $1;
This will look for any whole words that consist of BAYES_XX where XX is a
pair of numbers, and store the XX into $1, then only continue if those
numbers are not 99.
If you want something more readable but less efficient, you might try
if ( $names !~ /BAYES_99/ ) {
if ($names =~ /BAYES_([0-9][0-9])/) {
$bayes_score = $1;
Kelson Vibber
SpeedGate Communications <www.speed.net>
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
More information about the MIMEDefang
mailing list