diff options
author | Lucas Rolff <lucas@lucasrolff.com> | 2024-04-15 08:13:21 +0800 |
---|---|---|
committer | Lucas Rolff <lucas@lucasrolff.com> | 2024-04-15 08:13:21 +0800 |
commit | 458e980062a56bad80c6dda2eaffca2b5929bf9e (patch) | |
tree | 16a84bc61f84c6b968676e369dd3bd6dfafe5365 /lualib | |
parent | 5dce4c98e6ed4d95a031de5789ca055a6fd64880 (diff) | |
download | rspamd-458e980062a56bad80c6dda2eaffca2b5929bf9e.tar.gz rspamd-458e980062a56bad80c6dda2eaffca2b5929bf9e.zip |
[Minor] Add selector to get rspamd_hostname
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_selectors/extractors.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua index 81dfa9d4d..7a7f41a2f 100644 --- a/lualib/lua_selectors/extractors.lua +++ b/lualib/lua_selectors/extractors.lua @@ -17,6 +17,7 @@ limitations under the License. local fun = require 'fun' local meta_functions = require "lua_meta" local lua_util = require "lua_util" +local rspamd_util = require "rspamd_util" local rspamd_url = require "rspamd_url" local common = require "lua_selectors/common" local ts = require("tableshape").types @@ -560,6 +561,12 @@ The first argument must be header name.]], end, ['description'] = 'Get metatokens for a message as strings', }, + ['rspamd_hostname'] = { + ['get_value'] = function(task) + return rspamd_util.get_hostname(), 'string' + end, + ['description'] = 'Get hostname of the filter server', + }, } return extractors |