diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-01 16:49:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-01 16:49:39 +0000 |
commit | 3cddb1286bc8e2c2a0dd24fe0114e28597b34e4c (patch) | |
tree | bb5c347fea840bb462bda9d88b10279203cd3da1 | |
parent | 3a58c2c32ff44781e0401d9c94906f41a8272ad3 (diff) | |
parent | a2689e7b17f16bfcc3d15b66e1d65a18c0fe60e0 (diff) | |
download | rspamd-3cddb1286bc8e2c2a0dd24fe0114e28597b34e4c.tar.gz rspamd-3cddb1286bc8e2c2a0dd24fe0114e28597b34e4c.zip |
Merge pull request #1389 from fatalbanana/rip
[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) |