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 2006/07/11 20:13:47 UTC

svn commit: r420942 - in /spamassassin/branches/3.1: lib/Mail/SpamAssassin/EvalTests.pm rules/20_body_tests.cf

Author: felicity
Date: Tue Jul 11 11:13:47 2006
New Revision: 420942

URL: http://svn.apache.org/viewvc?rev=420942&view=rev
Log:
promote new eval rule into 3.1.4.  leaving as the default score of 1.0.

Modified:
    spamassassin/branches/3.1/lib/Mail/SpamAssassin/EvalTests.pm
    spamassassin/branches/3.1/rules/20_body_tests.cf

Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/lib/Mail/SpamAssassin/EvalTests.pm?rev=420942&r1=420941&r2=420942&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin/EvalTests.pm Tue Jul 11 11:13:47 2006
@@ -3144,4 +3144,21 @@
   return 0;
 }
 
+# came up on the users@ list, look for multipart/alternative parts which
+# include non-text parts -- skip certain types which occur normally in ham
+sub check_ma_non_text {
+  my $self = shift;
+
+  foreach my $map ($self->{msg}->find_parts(qr@^multipart/alternative$@i)) {
+    foreach my $p ($map->find_parts(qr/./, 1, 0)) {
+      next if (lc $p->{'type'} eq 'multipart/related');
+      next if (lc $p->{'type'} eq 'application/rtf');
+      next if ($p->{'type'} =~ m@^text/@i);
+      return 1;
+    }
+  }
+  
+  return 0;
+}
+
 1;

Modified: spamassassin/branches/3.1/rules/20_body_tests.cf
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/rules/20_body_tests.cf?rev=420942&r1=420941&r2=420942&view=diff
==============================================================================
--- spamassassin/branches/3.1/rules/20_body_tests.cf (original)
+++ spamassassin/branches/3.1/rules/20_body_tests.cf Tue Jul 11 11:13:47 2006
@@ -145,3 +145,5 @@
 
 rawbody INTERRUPTUS           /(?:[a-zA-Z0-9]<[\/ ]{0,2}?(?!br)(?!p)(?!sup)(?!li)(?!b)(?!i)(?!option)(?!a (?:href|name))(?:\b|!--)[^>]{0,64}?>[a-zA-Z0-9].{0,64}){3}/i
 describe INTERRUPTUS          Message looks to contain HTML-interrupted text
+
+body MULTIPART_ALT_NON_TEXT     eval:check_ma_non_text()