aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-07 16:21:00 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-07 16:21:00 +0300
commit8f1675ae06e1aa919d92fdabdc4e0d4e19c24d50 (patch)
treeafdb9c03b7a3cbecb2c250e08825423b20b0b0a0
parent6a305505b2129fd4d7ba8d394eb655f7956db51c (diff)
downloadrspamd-8f1675ae06e1aa919d92fdabdc4e0d4e19c24d50.tar.gz
rspamd-8f1675ae06e1aa919d92fdabdc4e0d4e19c24d50.zip
If message has no 'To/CC' headers do not try to count elements in nil table.
-rw-r--r--src/plugins/lua/forged_recipients.lua5
1 files changed, 4 insertions, 1 deletions
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