diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-19 22:17:41 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-19 22:17:41 +0000 |
commit | b8ea7f6b08f780a0463390934682a5e9cc5860df (patch) | |
tree | 5e4fd31131dd4feaa13b4b6e038f995cb0d40f00 /lualib | |
parent | 3ccc19f48ab648b22312c0a1169a57ba7e8d30bb (diff) | |
download | rspamd-b8ea7f6b08f780a0463390934682a5e9cc5860df.tar.gz rspamd-b8ea7f6b08f780a0463390934682a5e9cc5860df.zip |
[Minor] Selectors: Add get_urls_filtered extractor
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_selectors/extractors.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua index 0c82d1499..f8d8baf03 100644 --- a/lualib/lua_selectors/extractors.lua +++ b/lualib/lua_selectors/extractors.lua @@ -336,6 +336,21 @@ e.g. `get_tld`]], ignore_redirected = (ts.boolean + ts.string / lua_util.toboolean):is_optional(), }} }, + -- URLs filtered by flags + ['urls_filtered'] = { + ['get_value'] = function(task, args) + local urls = task:get_urls_filtered(args[1], args[2]) + if not urls[1] then + return nil + end + return urls,'userdata_list' + end, + ['description'] = [[Get list of all urls filtered by flags_include/exclude +(see rspamd_task:get_urls_filtered for description)]], + ['args_schema'] = {ts.array_of{ + url_flags_ts:is_optional(), url_flags_ts:is_optional() + }} + }, -- Get all emails ['emails'] = { ['get_value'] = function(task, args) |