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/12/31 23:37:41 UTC
svn commit: r123828 - in spamassassin/trunk: lib/Mail/SpamAssassin rules
Author: quinlan
Date: Fri Dec 31 14:37:39 2004
New Revision: 123828
URL: http://svn.apache.org/viewcvs?view=rev&rev=123828
Log:
various test rule work
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
spamassassin/trunk/rules/20_body_tests.cf
spamassassin/trunk/rules/20_head_tests.cf
spamassassin/trunk/rules/20_html_tests.cf
spamassassin/trunk/rules/20_phrases.cf
spamassassin/trunk/rules/70_testing.cf
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm?view=diff&rev=123828&p1=spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm&r1=123827&p2=spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm&r2=123828
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/HTML.pm Fri Dec 31 14:37:39 2004
@@ -606,9 +606,6 @@
$height = $1;
$height *= 6 if (defined $2 && $2 eq "%");
}
- if ($width <= 0 || $height <= 0) {
- $self->put_results(image_size_zero => 1);
- }
# guess size
$width = 200 if $width <= 0;
$height = 200 if $height <= 0;
Modified: spamassassin/trunk/rules/20_body_tests.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/20_body_tests.cf?view=diff&rev=123828&p1=spamassassin/trunk/rules/20_body_tests.cf&r1=123827&p2=spamassassin/trunk/rules/20_body_tests.cf&r2=123828
==============================================================================
--- spamassassin/trunk/rules/20_body_tests.cf (original)
+++ spamassassin/trunk/rules/20_body_tests.cf Fri Dec 31 14:37:39 2004
@@ -158,8 +158,8 @@
describe DOMAIN_RATIO Message body mentions many internet domains
# this could use more work
-body __LONGWORDS_A /\b(?:[a-z]{8,}\s+){6}/
-body __LONGWORDS_B /\b(?:[a-z]{6,}\s+){9}/
-body __LONGWORDS_C /\b(?:[a-z]{5,}\s+){10}/
+body __LONGWORDS_A /\b(?:[a-z]{8,}[\s\.]+){6}/
+body __LONGWORDS_B /\b(?:[a-z]{6,}[\s\.]+){9}/
+body __LONGWORDS_C /\b(?:[a-z]{5,}[\s\.]+){10}/
meta LONGWORDS (__LONGWORDS_A + __LONGWORDS_B + __LONGWORDS_C > 1)
describe LONGWORDS Long string of long words
Modified: spamassassin/trunk/rules/20_head_tests.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/20_head_tests.cf?view=diff&rev=123828&p1=spamassassin/trunk/rules/20_head_tests.cf&r1=123827&p2=spamassassin/trunk/rules/20_head_tests.cf&r2=123828
==============================================================================
--- spamassassin/trunk/rules/20_head_tests.cf (original)
+++ spamassassin/trunk/rules/20_head_tests.cf Fri Dec 31 14:37:39 2004
@@ -591,3 +591,10 @@
# thanks to David Ritz for passing this on; ready for post-3.0.0
header UNCLOSED_BRACKET ALL =~ /\[\d+\r?\n/s
describe UNCLOSED_BRACKET Headers contain an unclosed bracket
+
+# some header rules
+header ORG_MIME_TOOLS Organization =~ /MIME-tools/
+describe ORG_MIME_TOOLS Organization is MIME-tools
+
+header X_MIME_AUTOCONVERTED X-MIME-Autoconverted =~ /Yes/
+describe X_MIME_AUTOCONVERTED Message has X-MIME-Autoconverted "Yes" header
Modified: spamassassin/trunk/rules/20_html_tests.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/20_html_tests.cf?view=diff&rev=123828&p1=spamassassin/trunk/rules/20_html_tests.cf&r1=123827&p2=spamassassin/trunk/rules/20_html_tests.cf&r2=123828
==============================================================================
--- spamassassin/trunk/rules/20_html_tests.cf (original)
+++ spamassassin/trunk/rules/20_html_tests.cf Fri Dec 31 14:37:39 2004
@@ -205,6 +205,9 @@
body HTML_TAG_BALANCE_HEAD eval:html_tag_balance('head', '!= 0')
describe HTML_TAG_BALANCE_HEAD HTML has unbalanced "head" tags
+body HTML_TAG_EXIST_BGSOUND eval:html_tag_exists('bgsound')
+describe HTML_TAG_EXIST_BGSOUND HTML has "bgsound" tag
+
body HTML_TAG_EXIST_MARQUEE eval:html_tag_exists('marquee')
describe HTML_TAG_EXIST_MARQUEE HTML has "marquee" tag
@@ -282,6 +285,15 @@
body HTML_TITLE_EMPTY eval:html_text_not_match('title', '(?s)\S')
describe HTML_TITLE_EMPTY HTML title contains no text
+
+body __MIME_ATTACHMENT eval:check_for_mime('mime_attachment')
+
+body __HTML_TITLE_120 eval:html_text_match('title', '.{120}')
+meta HTML_TITLE_LONG __HTML_TITLE_120 && !__MIME_ATTACHMENT
+describe HTML_TITLE_LONG HTML title is very long
+
+body __HTML_TITLE_SUBJ_DIFF eval:html_title_subject_ratio('3.5')
+meta HTML_TITLE_SUBJ_DIFF __HTML_TITLE_SUBJ_DIFF && !__MIME_ATTACHMENT
body HTML_TITLE_UNTITLED eval:html_text_match('title', '(?i)(?:untitled|new page \d+)')
describe HTML_TITLE_UNTITLED HTML title contains "Untitled"
Modified: spamassassin/trunk/rules/20_phrases.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/20_phrases.cf?view=diff&rev=123828&p1=spamassassin/trunk/rules/20_phrases.cf&r1=123827&p2=spamassassin/trunk/rules/20_phrases.cf&r2=123828
==============================================================================
--- spamassassin/trunk/rules/20_phrases.cf (original)
+++ spamassassin/trunk/rules/20_phrases.cf Fri Dec 31 14:37:39 2004
@@ -37,6 +37,10 @@
body REMOVE_POSTAL /(?:Send(?:ing)? a (?:postal mail|postcard) to (?:Unsubscribe|Customer ?Service|remove)|unsubscribe by (?:postal mail|postcard))/i
describe REMOVE_POSTAL Send real mail to be unsubscribed
+# new way to phrase unsubscribe link
+body REMOVE_BEFORE_LINK m{(?:no thanks|not interested|unsubscribe here).{0,5}http://}i
+describe REMOVE_BEFORE_LINK Removal phrase right before a link
+
###########################################################################
# CLICK rules
# note HTML_LINK_CLICK* rules in HTML parser section
@@ -478,3 +482,10 @@
body SEE_FOR_YOURSELF /See (?:for|it|it for) yourself\b/i
describe SEE_FOR_YOURSELF See for yourself
+
+body __RUDE_HTML_1 /Get a capable html e-mailer/i
+body __RUDE_HTML_2 /not support the display of HTML. Please view this message in a different/i
+body __RUDE_HTML_3 /This message contains an HTML formatted message but your email client does/i
+body __RUDE_HTML_4 /Your mailer do not support HTML messages. Switch to a better mailer/i
+meta RUDE_HTML __RUDE_HTML_1 || __RUDE_HTML_2 || __RUDE_HTML_3 || __RUDE_HTML_4
+describe RUDE_HTML Spammer message says you need an HTML mailer
Modified: spamassassin/trunk/rules/70_testing.cf
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/70_testing.cf?view=diff&rev=123828&p1=spamassassin/trunk/rules/70_testing.cf&r1=123827&p2=spamassassin/trunk/rules/70_testing.cf&r2=123828
==============================================================================
--- spamassassin/trunk/rules/70_testing.cf (original)
+++ spamassassin/trunk/rules/70_testing.cf Fri Dec 31 14:37:39 2004
@@ -360,69 +360,8 @@
# bug 4023
body T_NO_SCRIP_NEEDED /no.{1,10}P(?:er|re)scription.{1,10}(?:needed|require|necessary)/i
-##########################################################################
-
-# new way to phrase unsubscribe link
-body T_NO_THANKS m{(?:no thanks|not interested|unsubscribe here).{0,5}http://}i
-
-# rude MUA programs
-body T_RUDE_MUA_1 /Get a capable html e-mailer/i
-body T_RUDE_MUA_2 /Switch to HTML version:/i
-body T_RUDE_MUA_3 /This message contains an HTML formatted message but your email client does/i
-body T_RUDE_MUA_4 /not support the display of HTML. Please view this message in a different/i
-body T_RUDE_MUA_5 /You must have a HTML capable browser to view this email/i
-body T_RUDE_MUA_6 /Your mailer do not support HTML messages. Switch to a better mailer/i
-body T_RUDE_MUA_7 /Votre lecteur d'email doit accepter le HTML/i
-body T_RUDE_MUA_8 eval:html_text_match('comment', 'You need an e-mail client capable of viewing HTML to view this message')
-
-# some header rules
-header T_ORG_MIME_TOOLS Organization =~ /MIME-tools/
-header T_UA_MIME_TOOLS User-Agent =~ /MIME-tools/
-header T_X_MIME_AUTOCONVERTED X-MIME-Autoconverted =~ /Yes/
-header X_ENCODING exists:X-Encoding
-header X_ENCODING_MIME X-Encoding =~ /MIME/
-
########################################################################
-body T_HTML_TAG_EXIST_BGSOUND eval:html_tag_exists('bgsound')
-
-body T_HTML_IMAGE_SIZE_ZERO eval:html_test('image_size_zero')
-
-# title trickery
-body __MIME_ATTACHMENT eval:check_for_mime('mime_attachment')
-
-body T_HTML_TITLE_80 eval:html_text_match('title', '.{80}')
-body T_HTML_TITLE_90 eval:html_text_match('title', '.{90}')
-body T_HTML_TITLE_100 eval:html_text_match('title', '.{100}')
-body T_HTML_TITLE_110 eval:html_text_match('title', '.{110}')
-body T_HTML_TITLE_120 eval:html_text_match('title', '.{120}')
-body T_HTML_TITLE_140 eval:html_text_match('title', '.{140}')
-body T_HTML_TITLE_160 eval:html_text_match('title', '.{160}')
-body T_HTML_TITLE_180 eval:html_text_match('title', '.{180}')
-body T_HTML_TITLE_200 eval:html_text_match('title', '.{200}')
-
-body T_TITLE_SUBJECT_RATIO_20 eval:html_title_subject_ratio('2.0')
-body T_TITLE_SUBJECT_RATIO_25 eval:html_title_subject_ratio('2.5')
-body T_TITLE_SUBJECT_RATIO_30 eval:html_title_subject_ratio('3.0')
-body T_TITLE_SUBJECT_RATIO_35 eval:html_title_subject_ratio('3.5')
-body T_TITLE_SUBJECT_RATIO_40 eval:html_title_subject_ratio('4.0')
-
-meta T_HTML_TITLE_80B T_HTML_TITLE_80 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_90B T_HTML_TITLE_90 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_100B T_HTML_TITLE_100 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_110B T_HTML_TITLE_110 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_120B T_HTML_TITLE_120 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_140B T_HTML_TITLE_140 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_160B T_HTML_TITLE_160 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_180B T_HTML_TITLE_180 && !__MIME_ATTACHMENT
-meta T_HTML_TITLE_200B T_HTML_TITLE_200 && !__MIME_ATTACHMENT
-
-meta T_TITLE_SUBJECT_RATIO_20B T_TITLE_SUBJECT_RATIO_20 && !__MIME_ATTACHMENT
-meta T_TITLE_SUBJECT_RATIO_25B T_TITLE_SUBJECT_RATIO_25 && !__MIME_ATTACHMENT
-meta T_TITLE_SUBJECT_RATIO_30B T_TITLE_SUBJECT_RATIO_30 && !__MIME_ATTACHMENT
-meta T_TITLE_SUBJECT_RATIO_35B T_TITLE_SUBJECT_RATIO_35 && !__MIME_ATTACHMENT
-meta T_TITLE_SUBJECT_RATIO_40B T_TITLE_SUBJECT_RATIO_40 && !__MIME_ATTACHMENT
-
# deal with those annoying probe-like mails
# For TVD:
# No subject or body text:
@@ -431,10 +370,15 @@
# 1.397 1.5609 0.0000 1.000 0.67 0.01 T_EMPTY_MSG2
# No subject exists and no body text and it's to undisclosed-recips:
# 1.351 1.5102 0.0000 1.000 0.33 0.01 T_EMPTY_MSG3
-meta T_EMPTY_MSG !__NONEMPTY_BODY
-meta T_EMPTY_MSG2 !__HAS_SUBJECT && !__NONEMPTY_BODY
-meta T_EMPTY_MSG3 UNDISC_RECIPS && !__HAS_SUBJECT && !__NONEMPTY_BODY
body __NONEMPTY_BODY /\S/
+meta T_EMPTY_MSG !__NONEMPTY_BODY
+meta T_EMPTY_MSG2 !__HAS_SUBJECT && !__NONEMPTY_BODY
+meta T_EMPTY_MSG3 UNDISC_RECIPS && !__HAS_SUBJECT && !__NONEMPTY_BODY
+meta T_EMPTY_MSG4 UNDISC_RECIPS && !__NONEMPTY_BODY
+# __MIME_ATTACHMENT defined in 20_html_tests.cf, put a note there
+# if one of these is promoted
+meta T_EMPTY_MSG5 !__MIME_ATTACHMENT && !__HAS_SUBJECT && !__NONEMPTY_BODY
+meta T_EMPTY_MSG6 !__MIME_ATTACHMENT && !__NONEMPTY_BODY
# idea of looking for consonant strings seen in airmax.cf
header T_NOVOWEL_FROM_6_LC From =~ /[bcdfghjklmnpqrstvwxyz]{6}/
@@ -511,10 +455,3 @@
uri T_NOVOWEL_URI2_8_AC m%^https?://[^/]*[bcdfghjklmnpqrstvwxyz]{8}%i
uri T_NOVOWEL_URI2_9_LC m%^https?://[^/]*[bcdfghjklmnpqrstvwxyz]{9}%
uri T_NOVOWEL_URI2_9_AC m%^https?://[^/]*[bcdfghjklmnpqrstvwxyz]{9}%i
-
-# idea to allow . in addition to \s seen in airmax.cf's MONOTONE_WORDS*
-# rules, but we'll try it in LONGWORDS to avoid duplication of effort
-body __T_LONGWORDS_A /\b(?:[a-z]{8,}[\s\.]+){6}/
-body __T_LONGWORDS_B /\b(?:[a-z]{6,}[\s\.]+){9}/
-body __T_LONGWORDS_C /\b(?:[a-z]{5,}[\s\.]+){10}/
-meta T_LONGWORDS (__T_LONGWORDS_A + __T_LONGWORDS_B + __T_LONGWORDS_C > 1)