From f9de08822c9dac84c30d1e7885d1400aa584a0b1 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 15 Dec 2016 11:38:26 +0200 Subject: [Minor] Avoid some table lookups in Lua parts --- src/plugins/lua/forged_recipients.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/lua/forged_recipients.lua') 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 -- cgit v1.2.3