You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/03/13 03:18:28 UTC

svn commit: rev 9394 - in incubator/spamassassin/trunk: lib/Mail/SpamAssassin lib/Mail/SpamAssassin/Message rules

Author: quinlan
Date: Fri Mar 12 18:18:27 2004
New Revision: 9394

Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
   incubator/spamassassin/trunk/rules/70_testing.cf
Log:
more HTML obfuscation


Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm	Fri Mar 12 18:18:27 2004
@@ -995,12 +995,25 @@
     if ($self->{html_text}[-1] =~ /\S*[A-Za-z]\S*\z/ &&
 	$text =~ /^\S*[A-Za-z]\S*/)
     {
-	$self->{html}{t_obfuscation2}++;
+      $self->{html}{t_obfuscation2}++;
     }
     if ($self->{html_text}[-1] =~ /\S*\w\S*\z/ &&
 	$text =~ /^\S*\w\S*/)
     {
-	$self->{html}{t_obfuscation3}++;
+      $self->{html}{t_obfuscation3}++;
+    }
+    # maybe later
+    # m{ [^ \Q \s()<>[]$,";/# \E ] \z }sx
+    # m{ [^\Q  \s () <> [] $,";/#  \E] \z }sx too
+    if ($self->{html_text}[-1] =~ m{[^\s\(\)\<\>\[\]\$\,\"\;\/\#]\z}s &&
+	$text =~ m{^[^\s\(\)\<\>\[\]\$\,\"\;\/\#]}s)
+    {
+      $self->{html}{t_obfuscation4}++;
+    }
+    if ($self->{html_text}[-1] =~ /[^\s\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]\z/s &&
+	$text =~ /^[^\s\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/s)
+    {
+      $self->{html}{t_obfuscation5}++;
     }
     if ($self->{html_text}[-1] =~ /\b(\w{1,7})$/s) {
       my $start = length($1);

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	Fri Mar 12 18:18:27 2004
@@ -392,6 +392,12 @@
       if (exists $r->{tags} && exists $r->{t_obfuscation3}) {
 	  $r->{t_obfuscation3_ratio} = $r->{t_obfuscation3} / $r->{tags};
       }
+      if (exists $r->{tags} && exists $r->{t_obfuscation4}) {
+	  $r->{t_obfuscation4_ratio} = $r->{t_obfuscation4} / $r->{tags};
+      }
+      if (exists $r->{tags} && exists $r->{t_obfuscation5}) {
+	  $r->{t_obfuscation5_ratio} = $r->{t_obfuscation5} / $r->{tags};
+      }
       if (exists $r->{attr_bad} && exists $r->{attr_all}) {
 	$r->{attr_bad} = $r->{attr_bad} / $r->{attr_all};
       }

Modified: incubator/spamassassin/trunk/rules/70_testing.cf
==============================================================================
--- incubator/spamassassin/trunk/rules/70_testing.cf	(original)
+++ incubator/spamassassin/trunk/rules/70_testing.cf	Fri Mar 12 18:18:27 2004
@@ -751,3 +751,29 @@
 body T_HTML_OBFUSCATE3_70_80 eval:html_range('t_obfuscation3_ratio','.7','.8')
 body T_HTML_OBFUSCATE3_80_90 eval:html_range('t_obfuscation3_ratio','.8','.9')
 body T_HTML_OBFUSCATE3_90_100 eval:html_range('t_obfuscation3_ratio','.9','1.0')
+
+body T_HTML_OBFUSCATE4X00_05 eval:html_range('t_obfuscation4_ratio','.0','.05')
+body T_HTML_OBFUSCATE4X05_10 eval:html_range('t_obfuscation4_ratio','.05','.1')
+body T_HTML_OBFUSCATE4_00_10 eval:html_range('t_obfuscation4_ratio','.0','.1')
+body T_HTML_OBFUSCATE4_10_20 eval:html_range('t_obfuscation4_ratio','.1','.2')
+body T_HTML_OBFUSCATE4_20_30 eval:html_range('t_obfuscation4_ratio','.2','.3')
+body T_HTML_OBFUSCATE4_30_40 eval:html_range('t_obfuscation4_ratio','.3','.4')
+body T_HTML_OBFUSCATE4_40_50 eval:html_range('t_obfuscation4_ratio','.4','.5')
+body T_HTML_OBFUSCATE4_50_60 eval:html_range('t_obfuscation4_ratio','.5','.6')
+body T_HTML_OBFUSCATE4_60_70 eval:html_range('t_obfuscation4_ratio','.6','.7')
+body T_HTML_OBFUSCATE4_70_80 eval:html_range('t_obfuscation4_ratio','.7','.8')
+body T_HTML_OBFUSCATE4_80_90 eval:html_range('t_obfuscation4_ratio','.8','.9')
+body T_HTML_OBFUSCATE4_90_100 eval:html_range('t_obfuscation4_ratio','.9','1.0')
+
+body T_HTML_OBFUSCATE5X00_05 eval:html_range('t_obfuscation5_ratio','.0','.05')
+body T_HTML_OBFUSCATE5X05_10 eval:html_range('t_obfuscation5_ratio','.05','.1')
+body T_HTML_OBFUSCATE5_00_10 eval:html_range('t_obfuscation5_ratio','.0','.1')
+body T_HTML_OBFUSCATE5_10_20 eval:html_range('t_obfuscation5_ratio','.1','.2')
+body T_HTML_OBFUSCATE5_20_30 eval:html_range('t_obfuscation5_ratio','.2','.3')
+body T_HTML_OBFUSCATE5_30_40 eval:html_range('t_obfuscation5_ratio','.3','.4')
+body T_HTML_OBFUSCATE5_40_50 eval:html_range('t_obfuscation5_ratio','.4','.5')
+body T_HTML_OBFUSCATE5_50_60 eval:html_range('t_obfuscation5_ratio','.5','.6')
+body T_HTML_OBFUSCATE5_60_70 eval:html_range('t_obfuscation5_ratio','.6','.7')
+body T_HTML_OBFUSCATE5_70_80 eval:html_range('t_obfuscation5_ratio','.7','.8')
+body T_HTML_OBFUSCATE5_80_90 eval:html_range('t_obfuscation5_ratio','.8','.9')
+body T_HTML_OBFUSCATE5_90_100 eval:html_range('t_obfuscation5_ratio','.9','1.0')