sb ch wrote:
Hello, all.
I think that html mail which bgcolor is not white is probably spam. So I made a rule like this. this rule is right?
body __BODY_XXXX_BGCOLOR /bgcolor/i
body __BODY_XXXX_BGCOLOR2 /white/i || /FFFFFF/i
meta XXXX_IMAGE_BGCOLOR (__BODY_XXXX_BGCOLOR && !__BODY_XXXX_BGCOLOR2)
score XXXX_IMAGE_BGCOLOR 4
Please recommed better rule.
and html mail which image border is not 0 is probably spam too. How can I make this rule?
There are meta rules in the next version of sare_html (ruleset 1) that check for white and near white colors:
rawbody __SARE_LIGHT_FG_COLOR /[^\-a-z]color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?![\s\'\"])(?:\#?(?!ffffff|fff\W)(?:[e-f]{3}\W|(?:[e-f][0-9a-f]){3})|rgb(?:\((?!\s*255\s*,\s*255\s*,\s*255)\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*\)|\((?!\s*100\s*%\s*,\s*100\s*%\s*,\s*100\s*%)\s*(?:100|9[0-9]|8[6-9])\s*%\s*,\s*(?:100|9[0-9]|8[6-9])\s*%\s*,\s*(?:100|9[0-9]|8[6-9])\s*%\s*\))|(?:Light(?:Cyan|Yellow)|(?:Ghost|Floral)White|WhiteSmoke|LemonChiffon|AliceBlue|Cornsilk|Seashell|Honeydew|Azure|MintCream|Snow|Ivory|OldLace|LavenderBlush|Linen|MistyRose))/i
rawbody __SARE_WHITE_FG_COLOR /[^\-a-z]color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?![\s\'\"])(?:\#?fff\W|\#?ffffff|rgb(?:\(\s*255\s*,\s*255\s*,\s*255\s*\)|\\s*100\s*%\s*,\s*100\s*%\s*,\s*100\s*%\s*\))|white)/i
rawbody __SARE_DARK_FG_COLOR /[^\-a-z]color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?![\s\'\"])(?:\#?(?!000000|000\W)(?:[01]{3}\W|(?:[01][0-9a-f]){3})|rgb(?:\((?!\s*0\s*,\s*0\s*,\s*0\D)\s*[0-3]?[0-9]\s*,\s*[0-3]?[0-9]\s*,\s*[0-3]?[0-9]\s*\)|\((?!\s*0\s*%\s*,\s*0\s*%\s*,\s*0\s*%)\s*(?:[1-3]?[0-9])\s*%\s*,\s*(?:[1-3]?[0-9])\s*%\s*,\s*(?:[1-3]?[0-9])\s*%\s*\)))/i
rawbody __SARE_BLACK_FG_COLOR /[^\-a-z]color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?![\s\'\"])(?:\#?000\W|\#?000000|rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)|rgb\s*\(\s*0\s*%\s*,\s*0\s*%\s*,\s*0\s*%\s*\)|black)/i
rawbody __SARE_LIGHT_BG_COLOR /(?:bg|background\-)color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?:\#?(?!ffffff|fff\W)(?:[e-f]{3}\W|(?:[e-f][0-9a-f]){3})|rgb(?:\((?!\s*255\s*,\s*255\s*,\s*255)\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*,\s*2[2-5][0-9]\s*\)|\((?!\s*100\s*%\s*,\s*100\s*%\s*,\s*100\s*%)\s*(?:100|9[0-9]|8[6-9])\s*%\s*,\s*(?:100|9[0-9]|8[6-9])\s*%\s*,\s*(?:100|9[0-9]|8[6-9])\s*%\s*\))|(?:Light(?:Cyan|Yellow)|(?:Ghost|Floral)White|WhiteSmoke|LemonChiffon|AliceBlue|Cornsilk|Seashell|Honeydew|Azure|MintCream|Snow|Ivory|OldLace|LavenderBlush|Linen|MistyRose))/i
rawbody __SARE_WHITE_BG_COLOR /(?:bg|background\-)color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?:\#?fff\W|\#?ffffff|rgb(?:\(\s*255\s*,\s*255\s*,\s*255\s*\)|\(\s*100\s*%\s*,\s*100\s*%\s*,\s*100\s*%\s*\))|white)/i
rawbody __SARE_DARK_BG_COLOR /(?:bg|background\-)color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?:\#?(?!000000|000\W)(?:[01]{3}\W|(?:[01][0-9a-f]){3})|rgb(?:\((?!\s*0\s*,\s*0\s*,\s*0\D)\s*[0-3]?[0-9]\s*,\s*[0-3]?[0-9]\s*,\s*[0-3]?[0-9]\s*\)|\((?!\s*0\s*%\s*,\s*0\s*%\s*,\s*0\s*%)\s*(?:[1-3]?[0-9])\s*%\s*,\s*(?:[1-3]?[0-9])\s*%\s*,\s*(?:[1-3]?[0-9])\s*%\s*\)))/i
rawbody __SARE_BLACK_BG_COLOR /(?:bg|background\-)color\s*(?::|=(?:3d)?(?!3d))[\s\'\"\#]*(?![\s\'\"])(?:\#?000\W|\#?000000|rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)|rgb\s*\(\s*0\s*%\s*,\s*0\s*%\s*,\s*0\s*%\s*\)|black)/i
rawbody __SARE_HAS_BG_COLOR /(?:bg|background\-)color\s*(?::|=)/i rawbody __SARE_HAS_FG_COLOR /[^\-a-z]color\s*(?::|=)/i
Watch the wrapping! These should help.
Example rules that would work with these are:
meta SARE_HTML_CLR_L_ON_W ( __SARE_LIGHT_FG_COLOR ) && !__SARE_WHITE_FG_COLOR && !__SARE_BLACK_BG_COLOR
score SARE_HTML_CLR_L_ON_W 1.666
describe SARE_HTML_CLR_L_ON_W Light color on a white background
meta SARE_HTML_CLR_L_ON_L ( __SARE_LIGHT_FG_COLOR && __SARE_LIGHT_BG_COLOR )
score SARE_HTML_CLR_L_ON_L 1.666
describe SARE_HTML_CLR_L_ON_L Light color on a light background
Jesse SARE Ninja http://www.rulesemporium.com
