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/06/26 05:29:20 UTC

svn commit: r417120 - in /spamassassin/rules/trunk/sandbox/felicity: 70_other.cf 70_phishing.cf sandbox-felicity.pm

Author: felicity
Date: Sun Jun 25 20:29:20 2006
New Revision: 417120

URL: http://svn.apache.org/viewvc?rev=417120&view=rev
Log:
implement a test rule from the mailing list, look for multipart/alternate sections which have non-text children

Modified:
    spamassassin/rules/trunk/sandbox/felicity/70_other.cf
    spamassassin/rules/trunk/sandbox/felicity/70_phishing.cf
    spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm

Modified: spamassassin/rules/trunk/sandbox/felicity/70_other.cf
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/felicity/70_other.cf?rev=417120&r1=417119&r2=417120&view=diff
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/70_other.cf (original)
+++ spamassassin/rules/trunk/sandbox/felicity/70_other.cf Sun Jun 25 20:29:20 2006
@@ -232,3 +232,12 @@
 # 0.650   0.7944   0.0000    1.000   1.00    0.01  TVD_MSGID_LOWERCASE
 # this came up on the irc channel
 header TVD_RATWARE_MSGID_02	Message-ID =~ /^[^<]*<[a-z]+\@/
+
+########################################################################
+loadplugin Mail::SpamAssassin::Plugin::Sandbox::felicity sandbox-felicity.pm
+
+ifplugin Mail::SpamAssassin::Plugin::Sandbox::felicity
+# 1.909   2.3080   0.0000    1.000   1.00    0.01  T_MULTIPART_ALT_NON_TEXT
+body MULTIPART_ALT_NON_TEXT	eval:check_ma_non_text()
+endif
+########################################################################

Modified: spamassassin/rules/trunk/sandbox/felicity/70_phishing.cf
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/felicity/70_phishing.cf?rev=417120&r1=417119&r2=417120&view=diff
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/70_phishing.cf (original)
+++ spamassassin/rules/trunk/sandbox/felicity/70_phishing.cf Sun Jun 25 20:29:20 2006
@@ -55,13 +55,6 @@
 describe T_LOCAL_PP_UPD_BADURL paypal account update, but has bad URL
 
 
-########################################################################
-#loadplugin Mail::SpamAssassin::Plugin::Sandbox::felicity sandbox-felicity.pm
-
-#ifplugin Mail::SpamAssassin::Plugin::Sandbox::felicity
-#endif
-########################################################################
-
 ifplugin Mail::SpamAssassin::Plugin::HTTPSMismatch
 
 # bug 4255: with some ideas from Fred Tarasevicius I came up with a rule that

Modified: spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm?rev=417120&r1=417119&r2=417120&view=diff
==============================================================================
--- spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm (original)
+++ spamassassin/rules/trunk/sandbox/felicity/sandbox-felicity.pm Sun Jun 25 20:29:20 2006
@@ -36,9 +36,23 @@
   bless ($self, $class);
 
   # the important bit!
-#  $self->register_eval_rule ("check_https_http_mismatch");
+  $self->register_eval_rule ("check_ma_non_text");
 
   return $self;
+}
+
+# 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, $pms) = @_;
+
+  foreach my $map ($pms->{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;