summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/forged_recipients.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-12-15 11:38:26 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-12-15 11:38:26 +0200
commitf9de08822c9dac84c30d1e7885d1400aa584a0b1 (patch)
treef52c1d8bfb99df6833ba8574379125f8fe2ad7e8 /src/plugins/lua/forged_recipients.lua
parent82c29e005bb28986ab2efcb45ec17abae0a81ad2 (diff)
downloadrspamd-f9de08822c9dac84c30d1e7885d1400aa584a0b1.tar.gz
rspamd-f9de08822c9dac84c30d1e7885d1400aa584a0b1.zip
[Minor] Avoid some table lookups in Lua parts
Diffstat (limited to 'src/plugins/lua/forged_recipients.lua')
-rw-r--r--src/plugins/lua/forged_recipients.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua
index 7c3cd07f8..0b6ff7911 100644
--- a/src/plugins/lua/forged_recipients.lua
+++ b/src/plugins/lua/forged_recipients.lua
@@ -20,6 +20,8 @@ limitations under the License.
local symbol_rcpt = 'FORGED_RECIPIENTS'
local symbol_sender = 'FORGED_SENDER'
+local E = {}
+
local function check_forged_headers(task)
local auser = task:get_user()
local smtp_rcpt = task:get_recipients(1)
@@ -48,7 +50,7 @@ local function check_forged_headers(task)
-- allow user to BCC themselves
res = true
break
- elseif smtp_from and smtp_from[1] and smtp_from[1]['addr'] and
+ elseif ((smtp_from or E)[1] or E).addr and
smtp_from[1]['addr'] == sr['addr'] then
-- allow sender to BCC themselves
res = true