]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix setting ratelimit key for 'ip' bucket 940/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 9 Sep 2016 14:55:17 +0000 (16:55 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 9 Sep 2016 14:55:17 +0000 (16:55 +0200)
src/plugins/lua/ratelimit.lua

index a4a870b09617ee400f75adfd16bdd2e9603a8c2d..9c6ff2ffea7b3541095b291a7c4917534c177ce0 100644 (file)
@@ -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