From: Vsevolod Stakhov Date: Thu, 1 Oct 2015 21:20:15 +0000 (+0100) Subject: Do not add FORGED_RECIPIENTS when 'To' is missing. X-Git-Tag: 1.0.4~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=458882675826a56b2191b7d79f5bb45cf9573a1c;p=rspamd.git Do not add FORGED_RECIPIENTS when 'To' is missing. Issue: #387 --- 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