diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-12-15 11:38:26 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-12-15 11:38:26 +0200 |
commit | f9de08822c9dac84c30d1e7885d1400aa584a0b1 (patch) | |
tree | f52c1d8bfb99df6833ba8574379125f8fe2ad7e8 /src/plugins/lua/mx_check.lua | |
parent | 82c29e005bb28986ab2efcb45ec17abae0a81ad2 (diff) | |
download | rspamd-f9de08822c9dac84c30d1e7885d1400aa584a0b1.tar.gz rspamd-f9de08822c9dac84c30d1e7885d1400aa584a0b1.zip |
[Minor] Avoid some table lookups in Lua parts
Diffstat (limited to 'src/plugins/lua/mx_check.lua')
-rw-r--r-- | src/plugins/lua/mx_check.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua index db2e51369..f81d5ba93 100644 --- a/src/plugins/lua/mx_check.lua +++ b/src/plugins/lua/mx_check.lua @@ -32,6 +32,8 @@ local settings = { } local redis_params +local E = {} + local function mx_check(task) local ip_addr = task:get_ip() if task:get_user() or (ip_addr and ip_addr:is_local()) then @@ -40,7 +42,7 @@ local function mx_check(task) local from = task:get_from('smtp') local mx_domain - if from and from[1] and from[1]['domain'] and not from[2] then + if ((from or E)[1] or E).domain and not from[2] then mx_domain = from[1]['domain'] else mx_domain = task:get_helo() |