diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-21 14:35:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-21 14:35:43 +0100 |
commit | 20f3cd1e223fed2bd7ea73ed90c1363b3f4d922e (patch) | |
tree | 825acda19825b360adc25677c59c5f4ee648912f | |
parent | 440902f91a5938f0fa711825bd54bd925ed42ca4 (diff) | |
download | rspamd-20f3cd1e223fed2bd7ea73ed90c1363b3f4d922e.tar.gz rspamd-20f3cd1e223fed2bd7ea73ed90c1363b3f4d922e.zip |
[Minor] Trim array instead of skipping checks
-rw-r--r-- | src/plugins/lua/forged_recipients.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua index 5869b784e..328644c8c 100644 --- a/src/plugins/lua/forged_recipients.lua +++ b/src/plugins/lua/forged_recipients.lua @@ -48,7 +48,9 @@ local function check_forged_headers(task) -- Find pair for each smtp recipient in To or Cc headers -- This cycle has O(N^2) complexity so it is better to limit number of iterations if #smtp_rcpt > 100 or #mime_rcpt > 100 then - return + -- Trim array, suggested by Anton Yuzhaninov + smtp_rcpt[100] = nil + mime_rcpt[100] = nil end for _,sr in ipairs(smtp_rcpt) do |