Ed,

> A request for a small change for the next version of amavisd:
>
> We'd like to log slightly more detailed info of the messages.  We use
> log_recip_templ, and it would be nice if we could store the score
> reported by spam assassin with a separate value for the
> whitelist/blacklist boost score.

A change in macro %c like the following?

--- amavisd.orig        Mon May  9 20:22:42 2005
+++ amavisd     Wed Jun 22 20:19:13 2005
@@ -6032,7 +6032,15 @@
     H => sub {[map {my $h=$_; chomp($h); $h} @{$MSGINFO->orig_header}]},# orig 
hdr
     A => sub {[split(/\r?\n/, $spam_report)]},      # SpamAssassin report lines
-    c => sub {!defined $spam_level ? '-'            # SA hits/score
-              : 0+sprintf("%.3f",$spam_level+min(map {$_->recip_score_boost}
-                                                @{$MSGINFO->per_recip_data}))},
+    c => sub { if (!defined($spam_level)) { '-' }
+               else {  # format SA score +/- by-sender score boosts
+                 my($sl) = 0+sprintf("%.3f",$spam_level);  # trim down fraction
+                 my(@boost) = map { my($b) = $_->recip_score_boost; 
+                                    !defined($b) ? undef : 0+sprintf("%.3f",$b)
+                                  } @{$MSGINFO->per_recip_data};
+                 !(grep { defined($_) && $_ != 0 } @boost) ? $sl
+                 : @boost==1 ? ($boost[0]>=0 ?$sl.'+'.$boost[0] :$sl.$boost[0])
+                 : $sl . '+(' . join(',',@boost) . ')';
+               }
+             },
     z => sub {$MSGINFO->orig_body_size+1+$MSGINFO->orig_header_size}, # mail 
size
     t => sub { # first entry in the Received trace
@@ -7559,6 +7567,13 @@
         for ($tag_level,$tag2_level,$kill_level) { $_ = 'x'  if !defined($_) }
         $mybuiltins{'R'} = $recip;
-        $mybuiltins{'c'} = !defined $spam_level ? '-'
-                                        : 0+sprintf("%.3f",$spam_level+$boost);
+        $mybuiltins{'c'} = do {  # format SA score +/- by-sender score boost
+          if (!defined($spam_level)) { '-' }
+          else {
+            my($sl) = 0+sprintf("%.3f",$spam_level);  # trim down fraction
+            my($b) = !defined $boost ? undef : 0+sprintf("%.3f",$boost);
+            !defined $boost || $boost == 0 ? $sl
+              : $boost >= 0 ? $sl.'+'.$b : $sl.$b;
+          }
+        };
         @mybuiltins{('0','1','2','k')} = ($is_local,$do_tag,$do_tag2,$do_kill);
         # macros %3, %4, %5 are experimental, until a better solution is found


Mark


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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