aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-09-09 16:55:17 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-09-09 16:55:17 +0200
commit8853969f24c8f0dd1da7f7689a1eb73a9ecef76c (patch)
tree53e2934eb94d358d3b76e673826a6c4e272643ec
parent0625542be15f6e3a9cc6209ce544adaa2a51bc30 (diff)
downloadrspamd-8853969f24c8f0dd1da7f7689a1eb73a9ecef76c.tar.gz
rspamd-8853969f24c8f0dd1da7f7689a1eb73a9ecef76c.zip
[Fix] Fix setting ratelimit key for 'ip' bucket
-rw-r--r--src/plugins/lua/ratelimit.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index a4a870b09..9c6ff2ffe 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -305,6 +305,8 @@ local function make_rate_key(rtype, args)
return string.format('%s:%s:%s', rl_prefix, rtype, args['asn'])
elseif rtype == 'user' and args['user'] then
return string.format('%s:%s:%s', rl_prefix, rtype, args['user'])
+ elseif rtype == 'ip' and args['ip'] and args['ip']:is_valid() then
+ return string.format('%s:%s', rl_prefix, args['ip']:to_string())
else
return nil
end