You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Nuno Fernandes <np...@eurotux.com> on 2014/04/07 11:08:01 UTC

Re: Disable awl when some other rule hit

> Nevertheless i think the following one liner would do the trick (have to
> test it though):
> 
> --- Mail/SpamAssassin/Plugin/AWL.pm.orig        2014-03-24
> 11:31:18.000000000 +0000
> +++ Mail/SpamAssassin/Plugin/AWL.pm     2014-03-24 11:31:20.000000000 +0000
> @@ -437,6 +437,7 @@
>        # or if the test is marked as "noautolearn"
>        next if !$scores->{$test};
>        next if exists $tflags->{$test} && $tflags->{$test} =~
> /\bnoautolearn\b/; +      return 0 if $tflags->{$test} =~ /\bnoawl\b/;
>        $points += $scores->{$test};
>      }
> 


The correct patch should be:

diff -Naur Mail-SpamAssassin-3.4.0.orig/lib/Mail/SpamAssassin/Plugin/AWL.pm 
Mail-SpamAssassin-3.4.0/lib/Mail/SpamAssassin/Plugin/AWL.pm
--- Mail-SpamAssassin-3.4.0.orig/lib/Mail/SpamAssassin/Plugin/AWL.pm    
2014-02-07 08:36:27.000000000 +0000
+++ Mail-SpamAssassin-3.4.0/lib/Mail/SpamAssassin/Plugin/AWL.pm 2014-03-25 
10:25:27.000000000 +0000
@@ -437,6 +437,7 @@
       # or if the test is marked as "noautolearn"
       next if !$scores->{$test};
       next if exists $tflags->{$test} && $tflags->{$test} =~ /\bnoautolearn\b/;
+      return 0 if exists $tflags->{$test} && $tflags->{$test} =~ /\bnoawl\b/;
       $points += $scores->{$test};
     }

As sa-learn was giving errors like:

Use of uninitialized value in pattern match (m//) at 
/usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/AWL.pm line 440.

Best regards,
Nuno Fernandes

Re: Disable awl when some other rule hit

Posted by Nuno Fernandes <np...@eurotux.com>.
On Monday 07 April 2014 08:00:38 Kevin A. McGrail wrote:
> Please move this patch to a bug for SA.  Add more comments and some
> documentation for the feature and I don't see why we couldn't patch for
> you.  However, also realize that I'm looking heavily at things like
> TxRep to replace AWL which is in trunk.

Done. Please find it at 
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7032

Best regards,
Nuno Fernandes

Re: Disable awl when some other rule hit

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 4/7/2014 5:08 AM, Nuno Fernandes wrote:
>> Nevertheless i think the following one liner would do the trick (have to
>> test it though):
>>
>> --- Mail/SpamAssassin/Plugin/AWL.pm.orig        2014-03-24
>> 11:31:18.000000000 +0000
>> +++ Mail/SpamAssassin/Plugin/AWL.pm     2014-03-24 11:31:20.000000000 +0000
>> @@ -437,6 +437,7 @@
>>         # or if the test is marked as "noautolearn"
>>         next if !$scores->{$test};
>>         next if exists $tflags->{$test} && $tflags->{$test} =~
>> /\bnoautolearn\b/; +      return 0 if $tflags->{$test} =~ /\bnoawl\b/;
>>         $points += $scores->{$test};
>>       }
>>
>
> The correct patch should be:
>
> diff -Naur Mail-SpamAssassin-3.4.0.orig/lib/Mail/SpamAssassin/Plugin/AWL.pm
> Mail-SpamAssassin-3.4.0/lib/Mail/SpamAssassin/Plugin/AWL.pm
> --- Mail-SpamAssassin-3.4.0.orig/lib/Mail/SpamAssassin/Plugin/AWL.pm
> 2014-02-07 08:36:27.000000000 +0000
> +++ Mail-SpamAssassin-3.4.0/lib/Mail/SpamAssassin/Plugin/AWL.pm 2014-03-25
> 10:25:27.000000000 +0000
> @@ -437,6 +437,7 @@
>         # or if the test is marked as "noautolearn"
>         next if !$scores->{$test};
>         next if exists $tflags->{$test} && $tflags->{$test} =~ /\bnoautolearn\b/;
> +      return 0 if exists $tflags->{$test} && $tflags->{$test} =~ /\bnoawl\b/;
>         $points += $scores->{$test};
>       }
>
> As sa-learn was giving errors like:
>
> Use of uninitialized value in pattern match (m//) at
> /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/AWL.pm line 440.
>
> Best regards,
> Nuno Fernandes
Please move this patch to a bug for SA.  Add more comments and some 
documentation for the feature and I don't see why we couldn't patch for 
you.  However, also realize that I'm looking heavily at things like 
TxRep to replace AWL which is in trunk.