From 20f3cd1e223fed2bd7ea73ed90c1363b3f4d922e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 May 2020 14:35:43 +0100 Subject: [Minor] Trim array instead of skipping checks --- src/plugins/lua/forged_recipients.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/lua') 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 -- cgit v1.2.3