From: Vsevolod Stakhov Date: Wed, 7 Dec 2011 13:21:00 +0000 (+0300) Subject: If message has no 'To/CC' headers do not try to count elements in nil table. X-Git-Tag: 0.4.6~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f1675ae06e1aa919d92fdabdc4e0d4e19c24d50;p=thirdparty%2Frspamd.git If message has no 'To/CC' headers do not try to count elements in nil table. --- diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua index 3665913778..a46776f914 100644 --- a/src/plugins/lua/forged_recipients.lua +++ b/src/plugins/lua/forged_recipients.lua @@ -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