aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-05-24 14:42:34 +0200
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-05-24 14:42:34 +0200
commit449a579a29ddd706550b763211f7f5aed850d364 (patch)
treed20e75eb38cb393d8f6004ba626cd1cc22de62b1 /src/plugins
parent714eb56e1760fdfb26afccde92664d3a2f1e8435 (diff)
downloadrspamd-449a579a29ddd706550b763211f7f5aed850d364.tar.gz
rspamd-449a579a29ddd706550b763211f7f5aed850d364.zip
[FIX] Ratelimit - fix set symbol only
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/ratelimit.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index e060fe084..a9fc7930f 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -377,7 +377,15 @@ 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
+ -- set symbol only and do NOT soft reject
+ if settings.symbol then
+ task:insert_result(settings.symbol, 0.0, 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, prefix)
end
rspamd_logger.infox(task,