diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/multimap.lua | 9 | ||||
-rw-r--r-- | src/plugins/lua/phishing.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index fe213b8e6..0366d4843 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -241,7 +241,8 @@ local function add_multimap_rule(params) header = nil, pattern = nil, map = nil, - symbol = nil + symbol = nil, + description = 'undefined multimap map' } for _,param in ipairs(params) do local _,_,name,value = string.find(param, '(%w+)%s*=%s*(.+)') @@ -272,6 +273,8 @@ local function add_multimap_rule(params) newrule['map'] = value elseif name == 'symbol' then newrule['symbol'] = value + elseif name == 'description' then + newrule['description'] = value else rspamd_logger.err('invalid rule option: '.. name) return nil @@ -295,7 +298,7 @@ local function add_multimap_rule(params) end else if newrule['type'] == 'ip' then - newrule['ips'] = rspamd_config:add_radix_map (newrule['map']) + newrule['ips'] = rspamd_config:add_radix_map (newrule['map'], newrule['description']) if newrule['ips'] then table.insert(rules, newrule) return newrule @@ -303,7 +306,7 @@ local function add_multimap_rule(params) rspamd_logger.warn('Cannot add rule: map doesn\'t exists: ' .. newrule['map']) end elseif newrule['type'] == 'header' or newrule['type'] == 'rcpt' or newrule['type'] == 'from' then - newrule['hash'] = rspamd_config:add_hash_map (newrule['map']) + newrule['hash'] = rspamd_config:add_hash_map (newrule['map'], newrule['description']) if newrule['hash'] then table.insert(rules, newrule) return newrule diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index e3def6fd9..4d72ff806 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -76,7 +76,7 @@ if opts then if type(rspamd_config.get_api_version) ~= 'nil' then rspamd_config:register_virtual_symbol(sym, 1) end - local rmap = rspamd_config:add_hash_map (map) + local rmap = rspamd_config:add_hash_map (map, 'Phishing strict domains map') if rmap then local rule = {symbol = sym, map = rmap} table.insert(strict_domains, rule) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 39bac5534..787f9fc94 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -305,7 +305,7 @@ if opts then end if opts['whitelisted_ip'] then - whitelisted_ip = rspamd_config:add_hash_map (opts['whitelisted_ip']) + whitelisted_ip = rspamd_config:add_hash_map (opts['whitelisted_ip'], 'Ratelimit whitelist ip map') end if opts['max_rcpt'] then @@ -323,4 +323,5 @@ if opts then rspamd_config:register_post_filter(rate_set) end end -end
\ No newline at end of file +end + |