aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-25 09:23:05 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-25 09:23:05 +0100
commit5a9e3b157da7fc5fe9ec1f185c242f2c937832eb (patch)
tree1c7b22fa5c85250e410e416740cbc2d806809e6d /src/plugins/lua
parent49852022963aba3dbce3591ac68fd2981b18710b (diff)
downloadrspamd-5a9e3b157da7fc5fe9ec1f185c242f2c937832eb.tar.gz
rspamd-5a9e3b157da7fc5fe9ec1f185c242f2c937832eb.zip
[Minor] Use extract specific urls for emails in rbl module
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/rbl.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index aacd2715c..83f57f495 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -52,7 +52,7 @@ local function get_monitored(rbl)
ret.prefix = rbl.monitored_address
end
- if rbl.dkim or rbl.url or rbl.email then
+ if rbl.dkim or rbl.urls or rbl.emails then
ret.random = true
end
@@ -388,9 +388,21 @@ local function gen_rbl_callback(rule)
end
local function check_emails(task, requests_table)
- local emails = task:get_emails()
+ local ex_params = {
+ task = task,
+ limit = rule.requests_limit,
+ filter = function(u) return u:get_protocol() == 'mailto' end,
+ need_emails = true,
+ prefix = 'rbl_email'
+ }
- if not emails then
+ if rule.emails_domainonly then
+ ex_params.esld_limit = 1
+ ex_params.prefix = 'rbl_email_domainonly'
+ end
+
+ local emails = lua_util.extract_specific_urls(ex_params)
+ if not emails or #emails == 0 then
return false
end