]> source.dussan.org Git - rspamd.git/commitdiff
Don't trigger HTML_SHORT_LINK_IMG on small images
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 20 Feb 2016 07:34:34 +0000 (10:34 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 20 Feb 2016 07:34:34 +0000 (10:34 +0300)
It's common for legitimate emails to have small image links (buttons, social networks junk e.t.c.)

rules/html.lua

index 0f26d14219ab010817fdb5b38e21ac4c0ced6b65..47ff528e83c2e2314170e80a25b1d5cbb2567724 100644 (file)
@@ -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