Mario,

> I try to get address extensions for spam working. But I'm not able to.
> I think this problem is caused somehow by the new parameter
> %addr_extension_maps_by_ccat.
> Does anybody have a hint how to get this working again?
>
> I have the following lines in amavisd.conf
> @addr_extension_spam_maps = ( 'spam' );
> $recipient_delimiter = '+';
> $sa_tag2_level_deflt = 5.5;

Your settings are correct, assuming that recipient is considered local.

What happened here is a change with 2.4.0, adding address extension
is now done at CC_SPAM, i.e. when score exceeds kill level.
Previously address extensions were inserted at tag2 level.

The change came with overall cleaning and generalizations,
but I see that it may be undesired, adding address extensions
at tag2 level was probably more appropriate.

Here is a patch to 2.4.0 which reverts the change, but using new
mechanism: a CC_CLEAN gets another minor contents category 9,
exceeded tag2 level labels mail as (CC_CLEAN,9), and address extensions
are added at (CC_CLEAN,9) as well as at CC_SPAM (i.e. kill level).
Also spam defanging (if enabled) is activated at (CC_CLEAN,9) (which
was on a TODO list for some time). So it should all work as before.

--- amavisd.orig        Mon Apr  3 16:32:34 2006
+++ amavisd     Tue Apr 11 12:21:01 2006
@@ -643,4 +643,5 @@
   CC_CATCHALL,  'CatchAll',  # last resort, should not normally appear
   CC_CLEAN,     'Clean',
+  CC_CLEAN.',9','Clean.Tag2',
   CC_TEMPFAIL,  'TempFail',
   CC_OVERSIZED, 'Oversized',
@@ -1068,4 +1069,5 @@
     CC_BADH,       sub { c('defang_bad_header')     || c('defang_all') },
     CC_UNCHECKED,  sub { c('defang_undecipherable') || c('defang_all') },
+    CC_CLEAN.",9", sub { c('defang_spam')           || c('defang_all') },
     CC_CATCHALL,   sub { c('defang_all') },
   );
@@ -1140,4 +1142,5 @@
     CC_SPAM,       sub { ca('addr_extension_spam_maps') },
     CC_BADH,       sub { ca('addr_extension_bad_header_maps') },
+    CC_CLEAN.",9", sub { ca('addr_extension_spam_maps') },
   );
 }
@@ -7607,17 +7610,25 @@
       # spaminess is an individual matter, we must compare spam level
       # with each recipient setting, there is no single global criterium
-      my($kill_level);
+      my($tag2_level,$kill_level,$bypassed);
       $kill_level = lookup(0,$recip, @{ca('spam_kill_level_maps')});
-      my($boost) = $r->recip_score_boost;
+      $bypassed   = lookup(0,$recip, @{ca('bypass_spam_checks_maps')});
+      my($blacklisted) = $r->recip_blacklisted_sender;
+      my($whitelisted) = $r->recip_whitelisted_sender;
+      my($boost)       = $r->recip_score_boost;
       $boost = 0  if !defined($boost);  # avoid uninitialized value warning
-      my($should_be_killed) =
-        !$r->recip_whitelisted_sender &&
-        ($r->recip_blacklisted_sender ||
-         (defined $kill_level && $spam_level+$boost >= $kill_level) );
-      if ($should_be_killed) {
+      my($do_kill) = !$whitelisted && ($blacklisted ||
+                  (defined $kill_level && $spam_level+$boost >= $kill_level) );
+      if ($do_kill) {
         # message spaminess is at or above kill level, or sender is blacklisted
         $msginfo->add_contents_category(CC_SPAM,0);
-        $r->add_contents_category(CC_SPAM,0)
-          if !lookup(0,$recip, @{ca('bypass_spam_checks_maps')});
+        $r->add_contents_category(CC_SPAM,0)  if !$bypassed;
+      } else {
+        $tag2_level = lookup(0,$recip, @{ca('spam_tag2_level_maps')});
+        my($do_tag2) = !$whitelisted && ($blacklisted ||
+                  (defined $tag2_level && $spam_level+$boost >= $tag2_level) );
+        if ($do_tag2) {
+          $msginfo->add_contents_category(CC_CLEAN,9);
+          $r->add_contents_category(CC_CLEAN,9)  if !$bypassed;
+        }
       }
       # consider adding CC_OVERSIZED to the contents_category list;
@@ -7678,6 +7689,7 @@
               ["552 5.3.4", "Message size ($mail_size B) ".
                                              "exceeds recipient's size limit"],
-            CC_CLEAN,    ["550 5.7.1", "CLEAN"],
-            CC_CATCHALL, ["550 5.7.1", "other"],
+            CC_CLEAN.',9',  ["550 5.7.1", "CLEAN.TAG2"],
+            CC_CLEAN,       ["550 5.7.1", "CLEAN"],
+            CC_CATCHALL,    ["550 5.7.1", "other"],
           });
           my($status,$reason);



Mark


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to