aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/whitelist.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua/whitelist.lua')
-rw-r--r--src/plugins/lua/whitelist.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua
index 0f4c41f85..7a196ec89 100644
--- a/src/plugins/lua/whitelist.lua
+++ b/src/plugins/lua/whitelist.lua
@@ -22,10 +22,14 @@ function check_whitelist (task)
-- check client's from domain
local from = task:get_from()
if from then
- local _,_,domain = string.find(from, '@(.+)>?$')
- local key = h:get_key(domain)
- if key then
- task:insert_result(symbol_from, 1)
+ local from_addr = from[1]['addr']
+
+ if from_addr then
+ local _,_,domain = string.find(from_addr, '@(.+)>?$')
+ local key = h:get_key(domain)
+ if key then
+ task:insert_result(symbol_from, 1)
+ end
end
end
end