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 2005/01/19 00:17:13 UTC

svn commit: r125562 - /spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm /spamassassin/trunk/rules/70_testing.cf

Author: quinlan
Date: Tue Jan 18 15:09:39 2005
New Revision: 125562

URL: http://svn.apache.org/viewcvs?view=rev&rev=125562
Log:
bug 3141: minor fix for matching Content-Type of text/html

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
   spamassassin/trunk/rules/70_testing.cf

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm?view=diff&rev=125562&p1=spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm&r1=125561&p2=spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm&r2=125562
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm	Tue Jan 18 15:09:39 2005
@@ -2283,7 +2283,7 @@
   my ($self) = @_;
 
   my $ctype = $self->get('Content-Type');
-  return 1 if (defined($ctype) && $ctype =~ m@text/html@i);
+  return 1 if (defined($ctype) && $ctype =~ m@^text/html@i);
 
   $self->_check_attachments unless exists $self->{mime_body_html_count};
   return ($self->{mime_body_html_count} > 0);
@@ -2291,19 +2291,6 @@
 
 # HTML without some other type of MIME text part
 sub check_for_mime_html_only {
-  my ($self) = @_;
-
-  my $ctype = $self->get('Content-Type');
-  return 1 if (defined($ctype) && $ctype =~ m@text/html@i);
-
-  $self->_check_attachments unless exists $self->{mime_body_html_count};
-  return ($self->{mime_body_html_count} > 0 &&
-	  $self->{mime_body_text_count} == 0);
-}
-
-# HTML without some other type of MIME text part
-# xxx, fixme, test rule, remove before release
-sub check_for_mime_html_only2 {
   my ($self) = @_;
 
   my $ctype = $self->get('Content-Type');

Modified: spamassassin/trunk/rules/70_testing.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/70_testing.cf?view=diff&rev=125562&p1=spamassassin/trunk/rules/70_testing.cf&r1=125561&p2=spamassassin/trunk/rules/70_testing.cf&r2=125562
==============================================================================
--- spamassassin/trunk/rules/70_testing.cf	(original)
+++ spamassassin/trunk/rules/70_testing.cf	Tue Jan 18 15:09:39 2005
@@ -308,109 +308,6 @@
 
 ########################################################################
 
-# short message-ids
-header T_MSGID_SHORT_A		MESSAGEID =~ /^.{1,15}$/
-header T_MSGID_SHORT_B		MESSAGEID =~ /^.{1,15}$/m
-header T_MSGID_SHORT_C		Message-Id =~ /^.{1,15}$/
-meta T_MSGID_SHORT_D		(T_MSGID_SHORT_A || T_MSGID_SHORT_B)
-meta T_MSGID_SHORT_E		(T_MSGID_SHORT_A || T_MSGID_SHORT_C)
-header T_MSGID_SHORT_LP_3	MESSAGEID =~ /<.{0,3}\@/
-header T_MSGID_SHORT_LP_4	MESSAGEID =~ /<.{0,4}\@/
-header T_MSGID_SHORT_LP_5	MESSAGEID =~ /<.{0,5}\@/
-meta T_MSGID_SHORT_LP_3A	T_MSGID_SHORT_LP_3 || T_MSGID_SHORT_A
-meta T_MSGID_SHORT_LP_4A	T_MSGID_SHORT_LP_4 || T_MSGID_SHORT_A
-meta T_MSGID_SHORT_LP_5A	T_MSGID_SHORT_LP_5 || T_MSGID_SHORT_A
-meta T_MSGID_SHORT_LP_3B	T_MSGID_SHORT_LP_3 || T_MSGID_SHORT_B
-meta T_MSGID_SHORT_LP_4B	T_MSGID_SHORT_LP_4 || T_MSGID_SHORT_B
-meta T_MSGID_SHORT_LP_5B	T_MSGID_SHORT_LP_5 || T_MSGID_SHORT_B
-meta T_MSGID_SHORT_LP_3C	T_MSGID_SHORT_LP_3 || T_MSGID_SHORT_C
-meta T_MSGID_SHORT_LP_4C	T_MSGID_SHORT_LP_4 || T_MSGID_SHORT_C
-meta T_MSGID_SHORT_LP_5C	T_MSGID_SHORT_LP_5 || T_MSGID_SHORT_C
-meta T_MSGID_SHORT_LP_3D	T_MSGID_SHORT_LP_3 || T_MSGID_SHORT_D
-meta T_MSGID_SHORT_LP_4D	T_MSGID_SHORT_LP_4 || T_MSGID_SHORT_D
-meta T_MSGID_SHORT_LP_5D	T_MSGID_SHORT_LP_5 || T_MSGID_SHORT_D
-meta T_MSGID_SHORT_LP_3E	T_MSGID_SHORT_LP_3 || T_MSGID_SHORT_E
-meta T_MSGID_SHORT_LP_4E	T_MSGID_SHORT_LP_4 || T_MSGID_SHORT_E
-meta T_MSGID_SHORT_LP_5E	T_MSGID_SHORT_LP_5 || T_MSGID_SHORT_E
-
-# some testing work on case-sensitive names
-header T_HEADER_01	ALL =~ /\nAlternate-Recipient:/
-header T_HEADER_02	ALL =~ /\nAntivirus:/
-header T_HEADER_03	ALL =~ /\nApproved:/
-header T_HEADER_04	ALL =~ /\nDelivery-Notification:/
-header T_HEADER_05	ALL =~ /\nDisclose-Recipients:/
-header T_HEADER_06	ALL =~ /\nError-path:/
-header T_HEADER_07	ALL =~ /\nLanguage:/
-header T_HEADER_08	ALL =~ /\nLocation:/
-header T_HEADER_09	ALL =~ /\nMime-Subversion:/
-header T_HEADER_10	ALL =~ /\nNewsletter-ID:/
-header T_HEADER_11	ALL =~ /\nPID:/
-header T_HEADER_12	ALL =~ /\nPrevent-NonDelivery-Report:/
-header T_HEADER_13	ALL =~ /\nRot:/
-header T_HEADER_14	ALL =~ /\nUID:/
-header T_HEADER_15	ALL =~ /\nX-BounceTrace:/
-header T_HEADER_16	ALL =~ /\nX-CS-IP:/
-header T_HEADER_17	ALL =~ /\nX-Camp...:/
-header T_HEADER_18	ALL =~ /\nX-ClientHost:/
-header T_HEADER_19	ALL =~ /\nX-Comment:/
-header T_HEADER_20	ALL =~ /\nX-Company-Address:/
-header T_HEADER_21	ALL =~ /\nX-Company-City:/
-header T_HEADER_22	ALL =~ /\nX-Company-Country:/
-header T_HEADER_23	ALL =~ /\nX-Company-State:/
-header T_HEADER_24	ALL =~ /\nX-Company-Zip:/
-header T_HEADER_25	ALL =~ /\nX-Contact:/
-header T_HEADER_26	ALL =~ /\nX-E(?:[Mm]ail)?:/
-header T_HEADER_27	ALL =~ /\nX-ENVID:/
-header T_HEADER_28	ALL =~ /\nX-EXP32-SerialNo:/
-header T_HEADER_29	ALL =~ /\nX-Encoding:/
-header T_HEADER_30	ALL =~ /\nX-Encoding-Version:/
-header T_HEADER_31	ALL =~ /\nX-Find:/
-header T_HEADER_32	ALL =~ /\nX-INFO_.Z:/
-header T_HEADER_33	ALL =~ /\nX-IP:/
-header T_HEADER_34	ALL =~ /\nX-JLH:/
-header T_HEADER_35	ALL =~ /\nX-L-C:/
-header T_HEADER_36	ALL =~ /\nX-LIDCode:/
-header T_HEADER_38	ALL =~ /\nX-Mailid:/
-header T_HEADER_39	ALL =~ /\nX-MailingID:/
-header T_HEADER_40	ALL =~ /\nX-Message-flag:/
-header T_HEADER_41	ALL =~ /\nX-MessageOrder:/
-header T_HEADER_42	ALL =~ /\nX-Misc_ID:/
-header T_HEADER_43	ALL =~ /\nX-Originating-Company:/
-header T_HEADER_44	ALL =~ /\nX-PMG-.+:/
-header T_HEADER_45	ALL =~ /\nX-POPFile-Link:/
-header T_HEADER_46	ALL =~ /\nX-RMD-Text:/
-header T_HEADER_47	ALL =~ /\nX-Rec:/
-header T_HEADER_48	ALL =~ /\nX-SG4:/
-header T_HEADER_49	ALL =~ /\nX-SP-Track-ID:/
-header T_HEADER_50	ALL =~ /\nX-Spam:/
-header T_HEADER_52	ALL =~ /\nX-TID:/
-header T_HEADER_53	ALL =~ /\nX-Text-Classification:/
-header T_HEADER_54	ALL =~ /\nX-Tnz-Problem-Type:/
-header T_HEADER_55	ALL =~ /\nX-Trans:/
-header T_HEADER_56	ALL =~ /\nX-Vig:/
-header T_HEADER_57	ALL =~ /\nX-WCMailID:/
-header T_HEADER_58	ALL =~ /\nX-Webmail-Time:/
-header T_HEADER_59	ALL =~ /\nX-[Ii][DdMm]?:/
-header T_HEADER_60	ALL =~ /\nX-[Ii][Dd]?:/
-header T_HEADER_61	ALL =~ /\nX-[Ii][Mm]?:/
-header T_HEADER_62	ALL =~ /\nX-bounce-to:/
-header T_HEADER_63	ALL =~ /\nX-cross:/
-header T_HEADER_64	ALL =~ /\nX-mlcipher:/
-header T_HEADER_65	ALL =~ /\nX-mlmsgid:/
-header T_HEADER_66	ALL =~ /\nX-mpm:/
-header T_HEADER_67	ALL =~ /\nX-ms:/
-header T_HEADER_68	ALL =~ /\nX-ntc:/
-header T_HEADER_69	ALL =~ /\nX-rco:/
-header T_HEADER_70	ALL =~ /\nX-srk:/
-header T_HEADER_71	ALL =~ /\nX-tri:/
-header T_HEADER_72	ALL =~ /\nX-yd:/
-
-# case-sensitive rule
-# only significant rules with no FPs, hit recently, on 2+ corpuses
-header T_HEADER_SPAM	ALL =~ /^(Alternate-Recipient|Antivirus|Approved|Delivery-Notification|Disclose-Recipients|Error-path|Language|Location|Mime-Subversion|Newsletter-ID|PID|Rot|UID|X-BounceTrace|X-CS-IP|X-Company-Address|X-Company-City|X-Company-Country|X-Company-State|X-Company-Zip|X-E(?:[Mm]ail)?|X-Encoding|X-Originating-Company|X-RMD-Text|X-SG4|X-SP-Track-ID|X-Webmail-Time|X-bounce-to):/m
-# try case-insensitive, for kicks
-header T_HEADER_SPAM_I	ALL =~ /^(Alternate-Recipient|Antivirus|Approved|Delivery-Notification|Disclose-Recipients|Error-path|Language|Location|Mime-Subversion|Newsletter-ID|PID|Rot|UID|X-BounceTrace|X-CS-IP|X-Company-Address|X-Company-City|X-Company-Country|X-Company-State|X-Company-Zip|X-E(?:[Mm]ail)?|X-Encoding|X-Originating-Company|X-RMD-Text|X-SG4|X-SP-Track-ID|X-Webmail-Time|X-bounce-to):/mi
-
 # bug 2004 - trivial rules
 rawbody T_HTML_FONT_SIZE_0PX	/<font\b[^>]+0px/i
 rawbody T_HTML_FONT_COLOR_WHITE	/<font\b[^>]+white/i
@@ -421,27 +318,10 @@
 uri T_URI_UPPER_LOWER_A	m{(?i:https?)://([A-Z][a-z]+\.){2,}[A-Za-z\d-]+\.[a-z]{2,4}\b}
 uri T_URI_UPPER_LOWER_B	m{(?i:https?)://([A-Z][a-z]+\.){2,}[A-Za-z\d-]+\.[a-z]{2,4}(?:[?/]|$)}
 
-# another one
-body T_VISIT_BEFORE_LINK_1	m{(?:visit us).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_2	m{(?:click here).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_3	m{(?:it at).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_4	m{(?:it here).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_5	m{(?:please visit).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_6	m{(?:here now).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_7	m{(?:message link).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_8	m{(?:corporate intro).{0,5}http://}i
-body T_VISIT_BEFORE_LINK_9	m{(?:proceed here).{0,5}http://}i
-
 # just a test...
 body T_ORANGES_AND_SPAM_POST	/[a-z]{3,},? Fl(?:orida)? (?:33|32|34)\d{3}\b/i
-body T_ORANGES_AND_SPAM_TELE_1	/\b1?\D{0,2}(?:239|305|321|352|386|407|561|727|754|772|786|813|850|863|904|941|954)\D{0,2}\d{3}\D{0,2}\d{4}\b/
-body T_ORANGES_AND_SPAM_TELE_2	/\b(?:239|305|321|352|386|407|561|727|754|772|786|813|850|863|904|941|954)\D{0,2}\d{3}\D{0,2}\d{4}\b/
-body T_CATTLE_AND_SPAM_POST	/[a-z]{3,},? (?:TX|Texas) (?:73|75|76|77|78|79|88)\d{3}\b/i
-body T_CATTLE_AND_SPAM_TELE_1	/\b1?\D{0,2}(?:210|214|254|281|325|361|409|430|432|469|512|682|713|806|817|830|832|903|915|936|940|956|972|979)\D{0,2}\d{3}\D{0,2}\d{4}\b/
-body T_CATTLE_AND_SPAM_TELE_2	/\b(?:210|214|254|281|325|361|409|430|432|469|512|682|713|806|817|830|832|903|915|936|940|956|972|979)\D{0,2}\d{3}\D{0,2}\d{4}\b/
-
-# bug 3557
-body T_STOCK_ALERT		/\bstock alert/i
-
-# bug 3141 - revert code if this has no improvement
-body T_MIME_HTML_ONLY		eval:check_for_mime_html_only2()
+body T_ORANGES_AND_SPAM_TELE	/\b1?\D{0,2}(?:239|305|321|352|386|407|561|727|754|772|786|813|850|863|904|941|954)\D{0,2}\d{3}\D{0,2}\d{4}\b/
+meta T_ORANGES_AND_SPAM_1	T_ORANGES_AND_SPAM_POST && T_ORANGES_AND_SPAM_TELE
+meta T_ORANGES_AND_SPAM_2	T_ORANGES_AND_SPAM_POST + T_ORANGES_AND_SPAM_TELE == 1
+meta T_ORANGES_AND_SPAM_3	T_ORANGES_AND_SPAM_POST && !T_ORANGES_AND_SPAM_TELE
+meta T_ORANGES_AND_SPAM_4	!T_ORANGES_AND_SPAM_POST && T_ORANGES_AND_SPAM_TELE