1 # SARE HTML Ruleset for SpamAssassin - ruleset 3
5 # Usage instructions, documentation, and change history in 70_sare_html0.cf
7 #@@# Revision History: Full Revision History stored in 70_sare_html.log
8 #@@# 01.03.10: June 3 2006
9 #@@# Minor score tweaks based on recent mass-checks
10 #@@# Modified "rule has been moved" meta flags
11 #@@# Archive: SARE_HTML_URI_OPTPHP
12 #@@# Moved file 1 to 3: SARE_HTML_URI_DEFASP
14 # License: Artistic - see http://www.rulesemporium.com/license.txt
15 # Current Maintainer: Bob Menschel - RMSA@Menschel.net
16 # Current Home: http://www.rulesemporium.com/rules/70_sare_html3.cf
18 ######## ###################### ##################################################
19 ######## ###################### ##################################################
20 # Rules renamed or moved
21 ######## ###################### ##################################################
23 meta __SARE_HEAD_FALSE __FROM_AOL_COM && !__FROM_AOL_COM
24 meta SARE_HTML_URI_OPTPHP __SARE_HEAD_FALSE
26 ######## ###################### ##################################################
28 body __NONEMPTY_BODY /\S/
29 header __TOCC_EXISTS exists:ToCc
31 rawbody __SARE_HTML_HAS_A eval:html_tag_exists('a')
32 rawbody __SARE_HTML_HAS_BR eval:html_tag_exists('br')
33 rawbody __SARE_HTML_HAS_DIV eval:html_tag_exists('div')
34 rawbody __SARE_HTML_HAS_FONT eval:html_tag_exists('font')
35 rawbody __SARE_HTML_HAS_IMG eval:html_tag_exists('img')
36 rawbody __SARE_HTML_HAS_P eval:html_tag_exists('p')
37 rawbody __SARE_HTML_HAS_PRE eval:html_tag_exists('pre')
38 rawbody __SARE_HTML_HAS_TITLE eval:html_tag_exists('title')
40 rawbody __SARE_HTML_HBODY m'<html><body>'i
41 rawbody __SARE_HTML_BEHTML m'<body></html>'i
42 rawbody __SARE_HTML_BEHTML2 m'^</?body></html>'i
43 rawbody __SARE_HTML_EFONT m'^</font>'i
44 rawbody __SARE_HTML_EHEB m'^</html></body>'i
45 rawbody __SARE_HTML_CMT_CNTR /<center><!--/
47 ######## ###################### ##################################################
49 ######## ###################### ##################################################
51 meta SARE_HTML_EMPTY __CTYPE_HTML && !( __SARE_HTML_HAS_TITLE || __TAG_EXISTS_HTML || __SARE_HTML_HAS_FONT || __TAG_EXISTS_BODY || __SARE_HTML_HAS_PRE || __SARE_HTML_HAS_DIV || __SARE_HTML_HAS_P || __SARE_HTML_HAS_A || __SARE_HTML_HAS_BR )
52 describe SARE_HTML_EMPTY Email is HTML format, but common tags not found
53 score SARE_HTML_EMPTY 0.681
54 #ham SARE_HTML_EMPTY An "html" format email, 30 Oct 2002, Microsoft Outlook Express 6.00.2600.0000, that used no tags, just one long textual paragraph
55 #counts SARE_HTML_EMPTY 226s/7h of 333405 corpus (262498s/70907h RM) 05/12/06
56 #max SARE_HTML_EMPTY 506s/33h of 689155 corpus (348140s/341015h RM) 09/18/05
57 #counts SARE_HTML_EMPTY 28s/1h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
58 #max SARE_HTML_EMPTY 32s/2h of 54283 corpus (17106s/37177h JH-3.01) 02/13/05
59 #counts SARE_HTML_EMPTY 0s/0h of 57287 corpus (52272s/5015h MY) 09/22/05
60 #max SARE_HTML_EMPTY 132s/2h of 26326 corpus (22886s/3440h MY) 02/15/05
61 #counts SARE_HTML_EMPTY 0s/0h of 13284 corpus (7412s/5872h CT) 05/14/06
62 #max SARE_HTML_EMPTY 12s/0h of 10826 corpus (6364s/4462h CT) 05/28/05
63 #counts SARE_HTML_EMPTY 1s/173h of 7500 corpus (1767s/5733h ft) 09/18/05
65 ######## ###################### ##################################################
66 # <HTML> and <BODY> tag spamsign
67 ######## ###################### ##################################################
69 rawbody __SARE_HTML_BODY_END2 m'</body[^>]*>.*</body[^>]*>'i
70 meta SARE_HTML_BODY_END2 __SARE_HTML_BODY_END2
71 describe SARE_HTML_BODY_END2 Double </body>
72 score SARE_HTML_BODY_END2 0.444
73 #hist SARE_HTML_BODY_END2 Contrib by Matt Keller June 7 2004
74 #note SARE_HTML_BODY_END2 Add/remove HTML_MESSAGE test has no effect
75 #counts SARE_HTML_BODY_END2 15s/1h of 333405 corpus (262498s/70907h RM) 05/12/06
76 #max SARE_HTML_BODY_END2 163s/13h of 281655 corpus (110173s/171482h RM) 05/05/05
77 #counts SARE_HTML_BODY_END2 2s/1h of 9988 corpus (5657s/4331h AxB) 05/14/06
78 #counts SARE_HTML_BODY_END2 1s/1h of 13284 corpus (7412s/5872h CT) 05/14/06
79 #max SARE_HTML_BODY_END2 6s/0h of 10826 corpus (6364s/4462h CT) 05/28/05
80 #counts SARE_HTML_BODY_END2 6s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
81 #counts SARE_HTML_BODY_END2 0s/7h of 42328 corpus (34212s/8116h FVGT) 05/15/06
82 #counts SARE_HTML_BODY_END2 15s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
83 #max SARE_HTML_BODY_END2 63s/0h of 38858 corpus (15368s/23490h JH-SA3.0rc1) 08/22/04
84 #counts SARE_HTML_BODY_END2 13s/0h of 106399 corpus (73151s/33248h ML) 05/14/06
85 #counts SARE_HTML_BODY_END2 52s/2h of 23053 corpus (17334s/5719h MY) 05/14/06
86 #max SARE_HTML_BODY_END2 69s/2h of 57287 corpus (52272s/5015h MY) 09/22/05
88 rawbody SARE_HTML_HTML_DBL /<html[^>]*><html[^>]*>/i
89 describe SARE_HTML_HTML_DBL Message body has very strange HTML sequence
90 score SARE_HTML_HTML_DBL 0.639
91 #ham SARE_HTML_HTML_DBL Verified (several), common to various opt-in lists.
92 #hist SARE_HTML_HTML_DBL Fred T: FR_HTML_HTML
93 #hist SARE_HTML_HTML_DBL 2004-06-11: [^>]* added by Bob Menschel
94 #counts SARE_HTML_HTML_DBL 7s/1h of 333405 corpus (262498s/70907h RM) 05/12/06
95 #max SARE_HTML_HTML_DBL 168s/0h of 65984 corpus (40739s/25245h RM) 08/21/04
96 #counts SARE_HTML_HTML_DBL 1s/0h of 9988 corpus (5657s/4331h AxB) 05/14/06
97 #counts SARE_HTML_HTML_DBL 0s/0h of 13284 corpus (7412s/5872h CT) 05/14/06
98 #max SARE_HTML_HTML_DBL 9s/0h of 6944 corpus (3188s/3756h CT) 05/19/04
99 #counts SARE_HTML_HTML_DBL 3s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
100 #counts SARE_HTML_HTML_DBL 25s/0h of 54283 corpus (17106s/37177h JH-3.01) 02/13/05
101 #max SARE_HTML_HTML_DBL 75s/0h of 32906 corpus (9660s/23246h JH) 05/24/04
102 #counts SARE_HTML_HTML_DBL 1s/0h of 106399 corpus (73151s/33248h ML) 05/14/06
103 #counts SARE_HTML_HTML_DBL 8s/1h of 23053 corpus (17334s/5719h MY) 05/14/06
104 #max SARE_HTML_HTML_DBL 10s/0h of 57287 corpus (52272s/5015h MY) 09/22/05
106 ######## ###################### ##################################################
108 ######## ###################### ##################################################
110 # Moved file 1 to 3: SARE_HTML_TITLE_MNY
111 rawbody SARE_HTML_TITLE_MNY /<title>.{0,25}Money.{0,25}<\/title>/i
112 describe SARE_HTML_TITLE_MNY HTML Title implies this may be spam
113 score SARE_HTML_TITLE_MNY 0.458
114 #ham SARE_HTML_TITLE_MNY confirmed
115 #hist SARE_HTML_TITLE_MNY Fred T: FR_TITLE_MONEY
116 #counts SARE_HTML_TITLE_MNY 16s/2h of 333405 corpus (262498s/70907h RM) 05/12/06
117 #max SARE_HTML_TITLE_MNY 260s/11h of 689155 corpus (348140s/341015h RM) 09/18/05
118 #counts SARE_HTML_TITLE_MNY 0s/0h of 13287 corpus (7414s/5873h CT) 05/14/06
119 #max SARE_HTML_TITLE_MNY 0s/1h of 6944 corpus (3188s/3756h CT) 05/19/04
120 #counts SARE_HTML_TITLE_MNY 0s/0h of 54283 corpus (17106s/37177h JH-3.01) 02/13/05
121 #max SARE_HTML_TITLE_MNY 7s/0h of 38858 corpus (15368s/23490h JH-SA3.0rc1) 08/22/04
122 #counts SARE_HTML_TITLE_MNY 2s/0h of 105856 corpus (72598s/33258h ML) 05/14/06
123 #counts SARE_HTML_TITLE_MNY 15s/0h of 23074 corpus (17350s/5724h MY) 05/14/06
124 #max SARE_HTML_TITLE_MNY 120s/0h of 57287 corpus (52272s/5015h MY) 09/22/05
126 ######## ###################### ##################################################
128 ######## ###################### ##################################################
130 ######## ###################### ##################################################
131 # Spamsign character sets and fonts
132 ######## ###################### ##################################################
134 rawbody SARE_HTML_COLOR_B /(?:style="?|<style[^>]*>)[^>"]*[^-]color\s*:\s*rgb\(\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*\)[^>]*>/i
135 describe SARE_HTML_COLOR_B BAD STYLE: color: too light (rgb(n))
136 score SARE_HTML_COLOR_B 0.621
137 #ham SARE_HTML_COLOR_B Tickemaster ticket confirmation emails
138 #hist SARE_HTML_COLOR_B From Jesse Houwing May 14 2004
139 #counts SARE_HTML_COLOR_B 20s/4h of 333405 corpus (262498s/70907h RM) 05/12/06
140 #counts SARE_HTML_COLOR_B 2s/8h of 9988 corpus (5657s/4331h AxB) 05/14/06
141 #counts SARE_HTML_COLOR_B 1s/1h of 13284 corpus (7412s/5872h CT) 05/14/06
142 #counts SARE_HTML_COLOR_B 47s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
143 #counts SARE_HTML_COLOR_B 0s/1h of 42328 corpus (34212s/8116h FVGT) 05/15/06
144 #counts SARE_HTML_COLOR_B 3s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
145 #max SARE_HTML_COLOR_B 5s/0h of 54283 corpus (17106s/37177h JH-3.01) 02/13/05
146 #counts SARE_HTML_COLOR_B 12s/0h of 106399 corpus (73151s/33248h ML) 05/14/06
147 #counts SARE_HTML_COLOR_B 8s/0h of 23053 corpus (17334s/5719h MY) 05/14/06
149 rawbody SARE_HTML_LANG_PTBR /lang=(?:3D)?PT-BR/
150 describe SARE_HTML_LANG_PTBR Odd language
151 score SARE_HTML_LANG_PTBR 0.189
152 #hist SARE_HTML_LANG_PTBR LW_PT_BR, Loren Wilton
153 #counts SARE_HTML_LANG_PTBR 11s/0h of 333405 corpus (262498s/70907h RM) 05/12/06
154 #max SARE_HTML_LANG_PTBR 213s/0h of 70693 corpus (43127s/27566h RM) 10/02/04
155 #counts SARE_HTML_LANG_PTBR 0s/1h of 56020 corpus (51687s/4333h AxB2) 05/15/06
156 #counts SARE_HTML_LANG_PTBR 9s/25h of 13284 corpus (7412s/5872h CT) 05/14/06
157 #counts SARE_HTML_LANG_PTBR 1s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
158 #counts SARE_HTML_LANG_PTBR 69s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
159 #counts SARE_HTML_LANG_PTBR 2s/0h of 106399 corpus (73151s/33248h ML) 05/14/06
160 #counts SARE_HTML_LANG_PTBR 0s/0h of 47221 corpus (42968s/4253h MY) 06/18/05
161 #max SARE_HTML_LANG_PTBR 10s/0h of 19448 corpus (16863s/2585h MY) 10/05/04
163 ######## ###################### ##################################################
164 # Invalid or Suspicious URI Tests
165 ######## ###################### ##################################################
167 uri SARE_HTML_URI_DEFASP m'/default.asp\?id='i
168 describe SARE_HTML_URI_DEFASP URI to page name which suggests spammer's page
169 score SARE_HTML_URI_DEFASP 0.093
170 #hist SARE_HTML_URI_DEFASP Deleted SARE_HTML_URI_X1 = LW_URI_ID due to complete overlap: /\?id\x10\x30\x34\x35/i
171 #counts SARE_HTML_URI_DEFASP 0s/8h of 333405 corpus (262498s/70907h RM) 05/12/06
172 #max SARE_HTML_URI_DEFASP 130s/27h of 689155 corpus (348140s/341015h RM) 09/18/05
173 #counts SARE_HTML_URI_DEFASP 0s/5h of 13287 corpus (7414s/5873h CT) 05/14/06
174 #max SARE_HTML_URI_DEFASP 44s/0h of 6944 corpus (3188s/3756h CT) 05/19/04
175 #counts SARE_HTML_URI_DEFASP 1s/1h of 42454 corpus (34336s/8118h FVGT) 05/15/06
176 #counts SARE_HTML_URI_DEFASP 0s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
177 #max SARE_HTML_URI_DEFASP 361s/0h of 38858 corpus (15368s/23490h JH-SA3.0rc1) 08/22/04
178 #counts SARE_HTML_URI_DEFASP 24s/0h of 23074 corpus (17350s/5724h MY) 05/14/06
179 #max SARE_HTML_URI_DEFASP 24s/0h of 57287 corpus (52272s/5015h MY) 09/22/05
181 ######## ###################### ##################################################
183 ######## ###################### ##################################################
185 ######## ###################### ##################################################
186 # Paragraphs, breaks, and spacings
187 ######## ###################### ##################################################
189 rawbody SARE_HTML_P_MANY3 /<P><P><P>/i
190 describe SARE_HTML_P_MANY3 Too many empty paragraph tags in a row
191 score SARE_HTML_P_MANY3 1.108
192 #hist SARE_HTML_P_MANY3 04/02/2004 http://www.rulesemporium.com/rules/99_FVGT_rawbody.cf
193 #overlap SARE_HTML_P_MANY3 Total overlap within SARE_HTML_URI_MANYP2, but no ham hits here (until Feb 2005)
194 #ham SARE_HTML_P_MANY3 From: Ticketmaster <support@reply.ticketmaster.com>, Tuesday, January 25, 2005, 4:00:27 PM
195 #counts SARE_HTML_P_MANY3 78s/6h of 333405 corpus (262498s/70907h RM) 05/12/06
196 #max SARE_HTML_P_MANY3 458s/28h of 689155 corpus (348140s/341015h RM) 09/18/05
197 #counts SARE_HTML_P_MANY3 143s/0h of 56020 corpus (51687s/4333h AxB2) 05/15/06
198 #counts SARE_HTML_P_MANY3 0s/0h of 11260 corpus (6568s/4692h CT) 06/17/05
199 #max SARE_HTML_P_MANY3 9s/0h of 6944 corpus (3188s/3756h CT) 05/19/04
200 #counts SARE_HTML_P_MANY3 412s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
201 #counts SARE_HTML_P_MANY3 50s/0h of 42328 corpus (34212s/8116h FVGT) 05/15/06
202 #counts SARE_HTML_P_MANY3 4s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
203 #max SARE_HTML_P_MANY3 15s/0h of 32260 corpus (8983s/23277h JH) 05/14/04
204 #counts SARE_HTML_P_MANY3 9s/0h of 23053 corpus (17334s/5719h MY) 05/14/06
205 #max SARE_HTML_P_MANY3 41s/0h of 57287 corpus (52272s/5015h MY) 09/22/05
207 ######## ###################### ##################################################
208 # Javascript and object tests
209 ######## ###################### ##################################################
211 ######## ###################### ##################################################
212 # Useless tags (tag structures that do nothing)
213 # Largely submitted by Matt Yackley, with contributions by
214 # Carl Friend, Jennifer Wheeler, Scott Sprunger, Larry Gilson
215 ######## ###################### ##################################################
217 rawbody SARE_HTML_USL_1CHAR m'(?!<[biopu]></[biopu]>)<([a-z])></\1>'i
218 describe SARE_HTML_USL_1CHAR Invalid and empty 1-char tag - /tag combination
219 score SARE_HTML_USL_1CHAR 0.029
220 #counts SARE_HTML_USL_1CHAR 6s/14h of 333405 corpus (262498s/70907h RM) 05/12/06
221 #max SARE_HTML_USL_1CHAR 46s/6h of 196718 corpus (96193s/100525h RM) 02/22/05
222 #counts SARE_HTML_USL_1CHAR 3s/0h of 56020 corpus (51687s/4333h AxB2) 05/15/06
223 #counts SARE_HTML_USL_1CHAR 0s/0h of 10826 corpus (6364s/4462h CT) 05/28/05
224 #max SARE_HTML_USL_1CHAR 3s/0h of 6944 corpus (3188s/3756h CT) 05/19/04
225 #counts SARE_HTML_USL_1CHAR 8s/30h of 155408 corpus (103805s/51603h DOC) 05/15/06
226 #counts SARE_HTML_USL_1CHAR 2s/1h of 42328 corpus (34212s/8116h FVGT) 05/15/06
227 #counts SARE_HTML_USL_1CHAR 3s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
228 #max SARE_HTML_USL_1CHAR 6s/0h of 54283 corpus (17106s/37177h JH-3.01) 02/13/05
229 #counts SARE_HTML_USL_1CHAR 2s/0h of 23053 corpus (17334s/5719h MY) 05/14/06
231 ######## ###################### ##################################################
232 # Miscellaneous tag tests
233 ######## ###################### ##################################################
235 rawbody SARE_HTML_BODY_2SP /<body /i
236 describe SARE_HTML_BODY_2SP HTML tag is strangely formed
237 score SARE_HTML_BODY_2SP 0.665
238 #hist SARE_HTML_BODY_2SP FR_BODY_2SPACES
239 #counts SARE_HTML_BODY_2SP 682s/152h of 333405 corpus (262498s/70907h RM) 05/12/06
240 #counts SARE_HTML_BODY_2SP 678s/2h of 9988 corpus (5657s/4331h AxB) 05/14/06
241 #counts SARE_HTML_BODY_2SP 48s/0h of 13284 corpus (7412s/5872h CT) 05/14/06
242 #counts SARE_HTML_BODY_2SP 215s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
243 #counts SARE_HTML_BODY_2SP 1455s/8h of 42328 corpus (34212s/8116h FVGT) 05/15/06
244 #counts SARE_HTML_BODY_2SP 62s/5h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
245 #max SARE_HTML_BODY_2SP 94s/0h of 38858 corpus (15368s/23490h JH-SA3.0rc1) 08/22/04
246 #counts SARE_HTML_BODY_2SP 361s/2h of 106399 corpus (73151s/33248h ML) 05/14/06
247 #counts SARE_HTML_BODY_2SP 21s/2h of 23053 corpus (17334s/5719h MY) 05/14/06
248 #max SARE_HTML_BODY_2SP 66s/2h of 47221 corpus (42968s/4253h MY) 06/18/05
250 full SARE_HTML_TD_BR m'<td.{10,400}<br>.{1,7}<br>.{1,7}<br>.{1,7}<br>.{0,400}</td>'is
251 describe SARE_HTML_TD_BR Multiple line breaks in spammer pattern
252 score SARE_HTML_TD_BR 0.934
253 #hist SARE_HTML_TD_BR Fred T: FR_WICKED_SPAM_??
254 #counts SARE_HTML_TD_BR 2757s/33h of 333405 corpus (262498s/70907h RM) 05/12/06
255 #counts SARE_HTML_TD_BR 368s/0h of 56020 corpus (51687s/4333h AxB2) 05/15/06
256 #counts SARE_HTML_TD_BR 40s/10h of 13284 corpus (7412s/5872h CT) 05/14/06
257 #counts SARE_HTML_TD_BR 471s/0h of 155408 corpus (103805s/51603h DOC) 05/15/06
258 #counts SARE_HTML_TD_BR 190s/10h of 42328 corpus (34212s/8116h FVGT) 05/15/06
259 #counts SARE_HTML_TD_BR 36s/0h of 54067 corpus (16890s/37177h JH-3.01) 06/18/05
260 #max SARE_HTML_TD_BR 182s/0h of 38858 corpus (15368s/23490h JH-SA3.0rc1) 08/22/04
261 #counts SARE_HTML_TD_BR 700s/0h of 106399 corpus (73151s/33248h ML) 05/14/06
262 #counts SARE_HTML_TD_BR 68s/14h of 23053 corpus (17334s/5719h MY) 05/14/06
263 #max SARE_HTML_TD_BR 184s/15h of 47221 corpus (42968s/4253h MY) 06/18/05