From: Andreas Simbuerger Date: Wed, 29 Mar 2023 16:08:57 +0000 (+0200) Subject: fix: avoid double-dip of nrcpt when calculating ratelimit condition X-Git-Tag: 3.6~176^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4448%2Fhead;p=thirdparty%2Frspamd.git 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. --- diff --git a/lualib/redis_scripts/ratelimit_check.lua b/lualib/redis_scripts/ratelimit_check.lua index aa7f564ef2..1c2b32a692 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