You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2005/11/30 05:09:11 UTC

svn commit: r349873 - in /spamassassin: rules/trunk/sandbox/felicity/70_other.cf trunk/lib/Mail/SpamAssassin/EvalTests.pm

Author: felicity
Date: Tue Nov 29 20:09:08 2005
New Revision: 349873

URL: http://svn.apache.org/viewcvs?rev=349873&view=rev
Log:
look for a new ratware format, the code is kind of icky but it works well at the moment

Modified:
    spamassassin/rules/trunk/sandbox/felicity/70_other.cf
    spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm

Modified: spamassassin/rules/trunk/sandbox/felicity/70_other.cf
URL: http://svn.apache.org/viewcvs/spamassassin/rules/trunk/sandbox/felicity/70_other.cf?rev=349873&r1=349872&r2=349873&view=diff
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/70_other.cf (original)
+++ spamassassin/rules/trunk/sandbox/felicity/70_other.cf Tue Nov 29 20:09:08 2005
@@ -40,3 +40,7 @@
 # tvd
 # 0.506   0.5714   0.0000    1.000   1.00    0.01  T_DRUGS_HDIA
 header T_DRUGS_HDIA	Subject =~ /\bhoodia\b/i
+
+# 0.603   0.6834   0.0000    1.000   1.00    0.01  T_TVD_RATWARE1
+body    T_TVD_RATWARE1  eval:message_ratware_format_1()
+

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?rev=349873&r1=349872&r2=349873&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Tue Nov 29 20:09:08 2005
@@ -3177,4 +3177,23 @@
   return($len < $max && $len >= $min);
 }
 
+# new ratware format, more complex than a standard rule can handle
+# unfortunately
+#word
+#some number of lines
+#word
+#\s*-------Original Message-------
+sub message_ratware_format_1 {
+  my($self, $body) = @_;
+  return unless $self->{'msg'}->{'type'} eq 'text/plain';
+  return unless (defined $body->[1] && $body->[1] =~ /^\s*\w+\s*[:,!.?-]*\s*$/);
+  my $i;
+  for($i=2;$i<10;$i++) {
+    last if (!defined $body->[$i] || $body->[$i] =~ /^\s*\w+\s*[:,!.?-]*\s*$/ || length($body->[$i]) > 100);
+  }
+  $i++;
+  return unless (defined $body->[$i] && $body->[$i] =~ /-\s*Original Message\s*-/i);
+  return 1;
+}
+
 1;



Re: svn commit: r349873 - in /spamassassin: rules/trunk/sandbox/felicity/70_other.cf trunk/lib/Mail/SpamAssassin/EvalTests.pm

Posted by Theo Van Dinter <fe...@apache.org>.
On Tue, Nov 29, 2005 at 08:43:30PM -0800, Justin Mason wrote:
> for what it's worth, it'd be cleaner to handle this with a plugin 
> in spamassassin/rules/trunk/sandbox/felicity/ratware.pm --
> if you feel like it ;)

Yeah, I thought about that.  I was doing 3 other things at the time and
just wanted to get it in so I wouldn't forget it was there.  I have a
few code functions at the bottom of EvalTests for test rules, so I'll
make them a plugin when I get the chance.  (worst case, someone remind
me at ApacheCon ...  ;) )

-- 
Randomly Generated Tagline:
"Remember: no matter where you go, there you are."