diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-25 09:37:53 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-25 09:37:53 +0100 |
commit | d448cacb053298e86e023ea6c793df9641ca3d7b (patch) | |
tree | 3b5eba80a8c7dce37e241c59a6d74586656842a2 /lualib/lua_util.lua | |
parent | 5a9e3b157da7fc5fe9ec1f185c242f2c937832eb (diff) | |
download | rspamd-d448cacb053298e86e023ea6c793df9641ca3d7b.tar.gz rspamd-d448cacb053298e86e023ea6c793df9641ca3d7b.zip |
[Minor] Some more adjustments to extract_specific
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r-- | lualib/lua_util.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index 6a43294c6..ce494ed51 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -683,8 +683,12 @@ exports.filter_specific_urls = function (urls, params) local function process_single_url(u, default_priority) local priority = default_priority or 1 -- Normal priority + local flags = u:get_flags() + if params.ignore_ip and flags.numeric then + return + end - if u:is_redirected() then + if flags.redirected then local redir = u:get_redirected() -- get the real url if params.ignore_redirected then @@ -702,13 +706,13 @@ exports.filter_specific_urls = function (urls, params) if esld then -- Special cases - if (u:get_protocol() ~= 'mailto') and (not u:is_html_displayed()) then - if u:is_obscured() then + if (u:get_protocol() ~= 'mailto') and (not flags.url_displayed) then + if flags.obscured then priority = 3 else - if u:get_user() then + if (flags.has_user or flags.has_port) then priority = 2 - elseif u:is_subject() or u:is_phished() then + elseif (flags.subject or flags.phished) then priority = 2 end end @@ -852,6 +856,7 @@ exports.extract_specific_urls = function(params_or_task, lim, need_emails, filte need_emails = false, filter = nil, prefix = nil, + ignore_ip = false, ignore_redirected = false, no_cache = false, } |