Amavisd with bogofilter

Stephen Davies sdavies at sdc.com.au
Wed Feb 1 11:01:11 CET 2012


The attached diff against amavisd-new-2.7.0 replaces Spam Assassin in amavisd 
with Bogofilter.

The resulting amavisd has been running here for over twelve hours and seems to 
work perfectly.

The only other changes were to the configuration file entries for:
$sa_tag_level_deflt  = 0;  # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 3;  # add 'spam detected' headers at that level
$sa_kill_level_deflt = 5;  # triggers spam evasive actions (e.g. blocks mail)

The first because I like to see spam info headers and the last to force 
quarantine of all spam as detected by bogofilter.

Enjoy,
Stephen

--------------------------------------------------------
944c945
<     ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin' ],
---
>   #  ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin' ],
957a959,962
>    ['Bogofilter',  'Amavis::SpamControl::ExtProg', 'bogofilter',
>      [ qw(-e -u -v)],
>      score_factor => 1.0,
>    ]
1045c1050
<   $final_spam_destiny       = D_PASS;
---
>   $final_spam_destiny       = D_DISCARD;
1121a1127,1131
>     X-Bogosity
>   );
>   $allowed_added_header_fields{lc($_)} = 0  for qw(
>     X-Spam-Status X-Spam-Level X-Spam-Flag X-Spam-Score
>     X-Spam-Report X-Spam-Checker-Version X-Spam-Tests
1123,1124d1132
<   $allowed_added_header_fields{lc('X-Spam-Report')} = 0;
<   $allowed_added_header_fields{lc('X-Spam-Checker-Version')} = 0;
24142c24150
<         if ($curr_head=~/^((?:X-DSPAM|X-CRM114)[^:]*?)[ \t]*:[ \t]*(.*)$/s) 
{
---
>         if ($curr_head=~/^((?:X-DSPAM|X-CRM114|X-Bogosity)[^:]*?)[ \t]*:[ 
\t]*(.*)$/s) {
24220a24229,24253
>   my($bogo_line) = $header_field{lc('X-Bogosity')};
>   my($bogo_status,$bogo_score,$bogo_tests);
>   if (defined $bogo_line) {
>     ($bogo_status,$bogo_tests,$bogo_score)=split(/,/,$bogo_line);
>     $bogo_score =~ s/ *spamicity=//;
>     s/[ \t\r\n]+\z//  for ($bogo_status, $bogo_score);
>     if ($bogo_status eq "Spam"){
> 	$spam_score = 5;
>     } else {
>       if ($bogo_status eq "Ham"){
> 	   $spam_score = 0;
>       } else {
> 	  $spam_score = 2;
>       }
>     }
> #    $spam_tests = sprintf("%s. %s Spamicity=%s",
> #                    $scanner_name, $bogo_status, $bogo_score);
>     $spam_tests = $bogo_line;
>     $msginfo->supplementary_info('AUTOLEARN','yes');
> #    $msginfo->supplementary_info('BOGOSTATUS',
> #                           sprintf("%s ( %s )", $bogo_status,$bogo_score));
> #    $msginfo->supplementary_info('BOGOSCORE',   $bogo_score);
>     do_log(2,"%s result: score=%s (%s), status=%s", $scanner_name,
>              $spam_score, $bogo_score, $bogo_status);
>   }


-- 
=============================================================================
Stephen Davies Consulting P/L                             Voice: 08-8177 1595
Adelaide, South Australia.                                Fax  : 08-8177 0133
Records & Collections Management.                         Mobile:040 304 0583


More information about the amavis-users mailing list