]> source.dussan.org Git - rspamd.git/commitdiff
Do not add FORGED_RECIPIENTS when 'To' is missing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 1 Oct 2015 21:20:15 +0000 (22:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 1 Oct 2015 21:20:15 +0000 (22:20 +0100)
Issue: #387

src/plugins/lua/forged_recipients.lua

index c4a00c57babf2cc95ce202ed1b42e46c6bb3aa99..c833986c9ae37760760f635248d21987d7cb4abb 100644 (file)
@@ -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