aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-02-01 18:28:30 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-02-01 18:28:30 +0200
commita2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0 (patch)
treebb5c347fea840bb462bda9d88b10279203cd3da1
parent3a58c2c32ff44781e0401d9c94906f41a8272ad3 (diff)
downloadrspamd-a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0.tar.gz
rspamd-a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0.zip
[Feature] Add `rip` keyword to ratelimit module
-rw-r--r--src/plugins/lua/ratelimit.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index c532e4379..d1503f3c3 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -113,6 +113,13 @@ local keywords = {
return nil
end,
},
+ ['rip'] = {
+ ['get_value'] = function(task)
+ local ip = task:get_ip()
+ if ip and ip:is_valid() and not ip:is_local() then return ip end
+ return nil
+ end,
+ },
['from'] = {
['get_value'] = function(task)
local from = task:get_from(0)