]> source.dussan.org Git - rspamd.git/commitdiff
If message has no 'To/CC' headers do not try to count elements in nil table.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 7 Dec 2011 13:21:00 +0000 (16:21 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 7 Dec 2011 13:21:00 +0000 (16:21 +0300)
src/plugins/lua/forged_recipients.lua

index 36659137787c6d86968aba18c4211ecce897d2d9..a46776f914b2d90f7b4621df55a718c2fb521071 100644 (file)
@@ -11,7 +11,10 @@ function check_forged_headers(task)
        
        if smtp_rcpt then
                local mime_rcpt = task:get_recipients_headers()
-               local count = table.maxn(mime_rcpt)
+               local count = 0
+               if mime_rcpt then 
+                       count = table.maxn(mime_rcpt)
+               end
                if count < table.maxn(smtp_rcpt) then
                        task:insert_result(symbol_rcpt, 1)
                else