spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felic...@apache.org
Subject svn commit: r417910 - in /spamassassin/trunk: lib/Mail/SpamAssassin/EvalTests.pm rules/20_body_tests.cf
Date Thu, 29 Jun 2006 00:38:26 GMT
Author: felicity
Date: Wed Jun 28 17:38:26 2006
New Revision: 417910

URL: http://svn.apache.org/viewvc?rev=417910&view=rev
Log:
move a test rule into EvalTests

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?rev=417910&r1=417909&r2=417910&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Wed Jun 28 17:38:26 2006
@@ -3081,4 +3081,18 @@
   return 1 if ($self->{tvd_vertical_words} >= $min && $self->{tvd_vertical_words}
< $max);
 }
 
+# came up on the users@ list, look for multipart/alternative parts which
+# include non-text parts -- skip multipart/related parts which occurs 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)) {
+      return 1 if ($p->{'type'} !~ m@^text/@i && $p->{'type'} !~ m@^multipart/related$@i);
+    }
+  }
+  
+  return 0;
+}
+
 1;

Modified: spamassassin/trunk/rules/20_body_tests.cf
URL: http://svn.apache.org/viewvc/spamassassin/trunk/rules/20_body_tests.cf?rev=417910&r1=417909&r2=417910&view=diff
==============================================================================
--- spamassassin/trunk/rules/20_body_tests.cf (original)
+++ spamassassin/trunk/rules/20_body_tests.cf Wed Jun 28 17:38:26 2006
@@ -28,3 +28,7 @@
 # messages where generally there are lots of spaces mean the message is spam.
 # 8.532  10.6051   0.1897    0.982   0.75    0.01  T_VERTICAL_WORDS_TVD_1
 body TVD_SPACE_RATIO	eval:tvd_vertical_words('0','10')
+
+# 0.767   0.9097   0.0000    1.000   0.84    1.00  MULTIPART_ALT_NON_TEXT
+body MULTIPART_ALT_NON_TEXT	eval:check_ma_non_text()
+



Mime
View raw message