summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Simbuerger <simbuerg@fim.uni-passau.de>2023-03-29 18:08:57 +0200
committerAndreas Simbuerger <simbuerg@fim.uni-passau.de>2023-03-29 18:08:57 +0200
commit092940ed5bf515c1176f1315b047ac1a76ae6733 (patch)
tree78f951996ae74be59aabc2744729bd7539333f79
parent415d7637aa80efa6f89bb148eabe1d79ea3c6391 (diff)
downloadrspamd-092940ed5bf515c1176f1315b047ac1a76ae6733.tar.gz
rspamd-092940ed5bf515c1176f1315b047ac1a76ae6733.zip
fix: avoid double-dip of nrcpt when calculating ratelimit condition
Before this commit, rspamd would consider the number of recipients of the current message twice when calculating the ratelimit condition.
-rw-r--r--lualib/redis_scripts/ratelimit_check.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lualib/redis_scripts/ratelimit_check.lua b/lualib/redis_scripts/ratelimit_check.lua
index aa7f564ef..1c2b32a69 100644
--- a/lualib/redis_scripts/ratelimit_check.lua
+++ b/lualib/redis_scripts/ratelimit_check.lua
@@ -62,7 +62,7 @@ if burst + pending > 0 then
if dynb == 0 then dynb = 0.0001 end
burst = burst + pending
- if burst > 0 and (burst + nrcpt) > max_burst * dynb then
+ if burst > 0 and burst > max_burst * dynb then
return {1, tostring(burst - pending), tostring(dynr), tostring(dynb), tostring(leaked)}
end
-- Increase pending if we allow ratelimit