From 458882675826a56b2191b7d79f5bb45cf9573a1c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 1 Oct 2015 22:20:15 +0100 Subject: [PATCH] Do not add FORGED_RECIPIENTS when 'To' is missing. Issue: #387 --- src/plugins/lua/forged_recipients.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua index c4a00c57b..c833986c9 100644 --- a/src/plugins/lua/forged_recipients.lua +++ b/src/plugins/lua/forged_recipients.lua @@ -41,9 +41,9 @@ local function check_forged_headers(task) if mime_rcpt then count = table.maxn(mime_rcpt) end - if count < table.maxn(smtp_rcpt) then + if count > 0 and count < table.maxn(smtp_rcpt) then task:insert_result(symbol_rcpt, 1) - else + elseif count > 0 then -- Find pair for each smtp recipient recipient in To or Cc headers for _,sr in ipairs(smtp_rcpt) do if mime_rcpt then -- 2.39.5