Re: [AMaViS-user] Determining which rules a clean message violated

2006-12-01 Thread Mark Martinec
Michael,

 ... To facilitate
 training I quarantine clean messages for 7 days along with all the
 others.  The problem I have, is in finding out which SpamAssassin rules a
 clean message actually triggered.  These show up in the headers of the
 delivered message, but not in the quarantined message nor anywhere in the
 database (that I can find).  Aside from going to the receiving user's
 mailbox and examining the delivered message, is there any way I can
 determine this?

Below is a patch to 2.4.4 which adds spam headers to quarantined mail
if spam score is at or above tag_level. Previously message needed to be
recognized as spammy or spam (tag2 or kill level) in order to receive
spam header fields in quarantine. This also makes it more consistent
with adding such header fields to passed mail.

  Mark

--- amavisd.origMon Nov 20 18:35:40 2006
+++ amavisd Fri Dec  1 17:45:02 2006
@@ -9223,5 +9223,6 @@
   my($newvirus_admin_maps_ref) =
  @virusname  !$virus_dejavu ? ca('newvirus_admin_maps') : undef;
-  my($blacklisted_any,$whitelisted_any,$do_tag2_any,$do_kill_any) = (0,0,0,0);
+  my($blacklisted_any,$whitelisted_any) = (0,0);
+  my($do_tag_any,$do_tag2_any,$do_kill_any) = (0,0,0);
   my($tag_level_min,$tag2_level_min,$kill_level_min,$boost_max);
   my($spam_level) = $msginfo-spam_level;
@@ -9230,5 +9231,5 @@
 my($rec) = $r-recip_addr;
 my($rec_ccat,$rec_ccat_min) = $r-main_contents_category;
-my($bypassed,$tag_level,$tag2_level,$kill_level,$do_tag2,$do_kill);
+my($bypassed,$tag_level,$tag2_level,$kill_level,$do_tag,$do_tag2,$do_kill);
 my($blacklisted) = $r-recip_blacklisted_sender;
 my($whitelisted) = $r-recip_whitelisted_sender;
@@ -9239,5 +9240,8 @@
$rec_ccat, $rec_ccat_min, $ccat, $ccat_min, $rec)
if $rec_ccat != $ccat || $rec_ccat_min != $ccat_min;
-if ($rec_ccat == CC_SPAM || $rec_ccat == CC_SPAMMY) {
+$do_tag  = $r-is_in_contents_category(CC_CLEAN,1);
+$do_tag2 = $r-is_in_contents_category(CC_SPAMMY);
+$do_kill = $r-is_in_contents_category(CC_SPAM);
+if ($do_tag || $do_tag2 || $do_kill) {
   # do the more expensive lookups only when needed
   $bypassed   = lookup(0,$rec, @{ca('bypass_spam_checks_maps')});
@@ -9246,6 +9250,4 @@
   $kill_level = lookup(0,$rec, @{ca('spam_kill_level_maps')});
 }
-$do_tag2 = $r-is_in_contents_category(CC_SPAMMY);
-$do_kill = $r-is_in_contents_category(CC_SPAM);
 # summarize
 $blacklisted_any=1  if $blacklisted;
@@ -9259,5 +9261,5 @@
 $boost_max = $boost  if defined($boost) 
   (!defined($boost_max) || $boost  $boost_max);
-#   $do_tag_any  = 1  if $do_tag;
+$do_tag_any  = 1  if $do_tag;
 $do_tag2_any = 1  if $do_tag2;
 $do_kill_any = 1  if $do_kill;
@@ -9345,6 +9347,5 @@
   $hdr_edits-add_header('X-Amavis-Alert', 'BAD HEADER '.$bad_headers[0]);
 }
-if ($msginfo-is_in_contents_category(CC_SPAM) ||
-$msginfo-is_in_contents_category(CC_SPAMMY)) {
+if ($do_tag_any || $do_tag2_any || $do_kill_any) {
   $hdr_edits-add_header('X-Spam-Flag',
  $do_tag2_any||$do_kill_any ? 'YES' : 'NO');



Mark

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/


Re: [AMaViS-user] Determining which rules a clean message violated

2006-11-30 Thread Leon Kolchinsky
Hi,

You have number of options to do that:
1. Check the file for particular scoring with:
# spamassassin -t -D  mailfile.
2. in amavisd.conf (this option will show you the scorings for all mails,
not only for spam):
$sa_tag_level_deflt  = -999;


Regards,
Leon Kolchinsky

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 4:30 PM
To: amavis-user@lists.sourceforge.net
Subject: [AMaViS-user] Determining which rules a clean message violated

I'm currently using a the common Postfix/Amavisd-new/SpamAssassin combo to 
filter messages before passing them onto my Lotus Domino server.  This is 
working well, and I've written a little PHP frontend to handle quarantine 
searches as well as releasing/training on messages.  To facilitate 
training I quarantine clean messages for 7 days along with all the 
others.  The problem I have, is in finding out which SpamAssassin rules a 
clean message actually triggered.  These show up in the headers of the 
delivered message, but not in the quarantined message nor anywhere in the 
database (that I can find).  Aside from going to the receiving user's 
mailbox and examining the delivered message, is there any way I can 
determine this?

Michael Gaskins
Berkeley County Government
Trainer/Application Developer (IT Department)
[EMAIL PROTECTED]
843-719-4759

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/