From 8f1675ae06e1aa919d92fdabdc4e0d4e19c24d50 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 7 Dec 2011 16:21:00 +0300 Subject: [PATCH] If message has no 'To/CC' headers do not try to count elements in nil table. --- src/plugins/lua/forged_recipients.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua index 366591377..a46776f91 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 -- 2.39.5