diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-24 16:00:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 16:00:42 +0100 |
commit | 08e99bfde4713e6253ce705926851c6639f65437 (patch) | |
tree | 6356119cec158d0049c2ec9704b4e02cac5e9668 /src | |
parent | 37ffe39a136a70806d41ecf01cd00f07f903717b (diff) | |
parent | 6c329fc735a1b71b1aeebfc96406f29e36c7b3ab (diff) | |
download | rspamd-08e99bfde4713e6253ce705926851c6639f65437.tar.gz rspamd-08e99bfde4713e6253ce705926851c6639f65437.zip |
Merge pull request #2264 from HeinleinSupport/master
Ratelimit - fix set symbol only
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index e060fe084..1d22f8838 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -377,8 +377,16 @@ local function ratelimit_cb(task) if err then rspamd_logger.errx('cannot check limit %s: %s %s', prefix, err, data) elseif type(data) == 'table' and data[1] and data[1] == 1 then - if settings.info_symbol then - task:insert_result(settings.info_symbol, 1.0, prefix) + -- set symbol only and do NOT soft reject + if settings.symbol then + task:insert_result(settings.symbol, 0.0, lim_name .. "(" .. prefix .. ")") + rspamd_logger.infox(task, + 'set_symbol_only: ratelimit "%s(%s)" exceeded, (%s / %s): %s (%s:%s dyn)', + lim_name, prefix, bucket[2], bucket[1], data[2], data[3], data[4]) + return + -- set INFO symbol and soft reject + elseif settings.info_symbol then + task:insert_result(settings.info_symbol, 1.0, lim_name .. "(" .. prefix .. ")") end rspamd_logger.infox(task, 'ratelimit "%s(%s)" exceeded, (%s / %s): %s (%s:%s dyn)', |