aboutsummaryrefslogtreecommitdiffstats
path: root/rules/forwarding.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-04 17:32:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-04 17:32:03 +0100
commitf5aac8de010eaf3221dd152e98a5f1a5208ecb2b (patch)
tree49cdb55445222c2286e6f098880cdc4f9233ea08 /rules/forwarding.lua
parentfe0b7b5c838bf966fabbb102d9fb8da93acdcaeb (diff)
downloadrspamd-f5aac8de010eaf3221dd152e98a5f1a5208ecb2b.tar.gz
rspamd-f5aac8de010eaf3221dd152e98a5f1a5208ecb2b.zip
[Fix] Avoid `table.getn` method as it has been removed in lua 5.3
Issue: #697 Reported by: @jessbo
Diffstat (limited to 'rules/forwarding.lua')
-rw-r--r--rules/forwarding.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/rules/forwarding.lua b/rules/forwarding.lua
index c5c8912af..68d0c1095 100644
--- a/rules/forwarding.lua
+++ b/rules/forwarding.lua
@@ -24,7 +24,7 @@ rspamd_config.FWD_GOOGLE = {
local envfrom = task:get_from(1)
local envrcpts = task:get_recipients(1)
-- Forwarding will only be to a single recipient
- if table.getn(envrcpts) > 1 then return false end
+ if #envrcpts > 1 then return false end
-- Get recipient and compute VERP address
local rcpt = envrcpts[1].addr:lower()
local verp = rcpt:gsub('@','=')
@@ -53,7 +53,7 @@ rspamd_config.FWD_SRS = {
local envfrom = task:get_from(1)
local envrcpts = task:get_recipients(1)
-- Forwarding is only to a single recipient
- if table.getn(envrcpts) > 1 then return false end
+ if #envrcpts > 1 then return false end
-- Get recipient and compute rewritten SRS address
local srs = '=' .. envrcpts[1].domain:lower() ..
'=' .. envrcpts[1].user:lower()
@@ -74,7 +74,7 @@ rspamd_config.FORWARDED = {
if not task:has_recipients(1) then return false end
local envrcpts = task:get_recipients(1)
-- Forwarding will only be for single recipient messages
- if table.getn(envrcpts) > 1 then return false end
+ if #envrcpts > 1 then return false end
-- Get any other headers we might need
local lu = task:get_header('List-Unsubscribe')
local to = task:get_recipients(2)