[Rt-commit] [svn] r1926 - in rt/branches/3.3-TESTING: . lib/RT/Interface/Email/Filter

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Mon Nov 22 13:52:27 EST 2004


Author: jesse
Date: Mon Nov 22 13:52:27 2004
New Revision: 1926

Modified:
   rt/branches/3.3-TESTING/   (props changed)
   rt/branches/3.3-TESTING/lib/RT/Interface/Email/Filter/SpamAssassin.pm
Log:
 r9326 at tinbook:  jesse | 2004-11-22T18:53:57.082454Z
 RT-Ticket: 6125
 RT-Status: resolved
 RT-Update: correspond
 
 SpamAssasin mail plugin overhauled (Petter Reinholdtsen)
 
 	The current code wipe out the CurrentUser variable, and must be called
 	first in the chain of plugins.  There is no good reason why it need to
 	do this, so I propose to change it to keep the CurrentUser value.
 	
 	Here is a patch to change the argument handling, to pass
 	$args{'Message'} to spamassasin, instead of the strange $item value.
 	The patch also make sure CurrentUser and AuthLevel is passed through
 	when no change is wanted.
 
 


Modified: rt/branches/3.3-TESTING/lib/RT/Interface/Email/Filter/SpamAssassin.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/Interface/Email/Filter/SpamAssassin.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/Interface/Email/Filter/SpamAssassin.pm	Mon Nov 22 13:52:27 2004
@@ -49,15 +49,24 @@
 my $spamtest = Mail::SpamAssassin->new();
 
 sub GetCurrentUser {
-    my $item = shift;
-    my $status = $spamtest->check ($item);
-    return (undef, 0) unless $status->is_spam();
+    my %args = (
+        Message     => undef,
+        CurrentUser => undef,
+        AuthLevel   => undef,
+        @_
+    );
+    my $status = $spamtest->check( $args{'Message'} );
+    return ( $args{'CurrentUser'}, $args{'AuthLevel'} )
+      unless $status->is_spam();
+
     eval { $status->rewrite_mail() };
-    if ($status->get_hits > $status->get_required_hits()*1.5) { 
+    if ( $status->get_hits > $status->get_required_hits() * 1.5 ) {
+
         # Spammy indeed
-        return (undef, -1);
+        return ( $args{'CurrentUser'}, -1 );
     }
-    return (undef, 0);
+    return ( $args{'CurrentUser'}, $args{'AuthLevel'} );
+
 }
 
 =head1 NAME


More information about the Rt-commit mailing list