aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-19 16:21:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-19 16:21:42 +0100
commited52028907d845d373c185131ea319833d4a812d (patch)
tree1c5ecbeab54e0371d89c3372529c1f0d1acff150 /lualib/lua_selectors
parentd0e5bf6d4a1a134ae4978a27e4b6e6466601cab0 (diff)
downloadrspamd-ed52028907d845d373c185131ea319833d4a812d.tar.gz
rspamd-ed52028907d845d373c185131ea319833d4a812d.zip
[Feature] Selectors: Add `specific_urls` extractor
Diffstat (limited to 'lualib/lua_selectors')
-rw-r--r--lualib/lua_selectors/extractors.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua
index a3fda891d..993169708 100644
--- a/lualib/lua_selectors/extractors.lua
+++ b/lualib/lua_selectors/extractors.lua
@@ -278,6 +278,23 @@ e.g. `by_hostname`]],
If no arguments specified, returns list of url objects. Otherwise, calls a specific method,
e.g. `get_tld`]],
},
+ -- Get specific urls
+ ['specific_urls'] = {
+ ['get_value'] = function(task, args)
+ local params = args[1] or {}
+ params.task = task
+ local urls = lua_util.extract_specific_urls(params)
+ return urls,'userdata_list'
+ end,
+ ['description'] = [[Get most specific urls. Arguments are equal to the Lua API function]],
+ ['args_schema'] = {ts.shape{
+ limit = ts.number + ts.string / tonumber,
+ esld_limit = (ts.number + ts.string / tonumber):is_optional(),
+ prefix = ts.string:is_optional(),
+ need_emails = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
+ ignore_redirected = (ts.boolean + ts.string / lua_util.toboolean):is_optional(),
+ }}
+ },
-- Get all emails
['emails'] = {
['get_value'] = function(task, args)