diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-02-01 18:28:30 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-02-01 18:28:30 +0200 |
commit | a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0 (patch) | |
tree | bb5c347fea840bb462bda9d88b10279203cd3da1 | |
parent | 3a58c2c32ff44781e0401d9c94906f41a8272ad3 (diff) | |
download | rspamd-a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0.tar.gz rspamd-a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0.zip |
[Feature] Add `rip` keyword to ratelimit module
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 7 |
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) |