summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2016-02-20 10:34:34 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2016-02-20 10:34:34 +0300
commitaf66bcae904101b46244bd16da1b9ed6533dccaf (patch)
treef6f8a7abbb7de5ba7576fd5c0d8b38ba9304f716 /rules
parent10e385ec78211ed42eb19fb413a59dfa09e8d5d8 (diff)
downloadrspamd-af66bcae904101b46244bd16da1b9ed6533dccaf.tar.gz
rspamd-af66bcae904101b46244bd16da1b9ed6533dccaf.zip
Don't trigger HTML_SHORT_LINK_IMG on small images
It's common for legitimate emails to have small image links (buttons, social networks junk e.t.c.)
Diffstat (limited to 'rules')
-rw-r--r--rules/html.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/rules/html.lua b/rules/html.lua
index 0f26d1421..47ff528e8 100644
--- a/rules/html.lua
+++ b/rules/html.lua
@@ -38,7 +38,10 @@ local function check_html_image(task, min, max)
local parent = tag:get_parent()
if parent then
if parent:get_type() == 'a' then
- return true
+ -- do not trigger on small and unknown size images
+ if i['height'] + i['width'] >= 210 then
+ return true
+ end
end
end
end