From 625d9161305393d89679650fe616707a4c090797 Mon Sep 17 00:00:00 2001 From: Simon Pin Date: Wed, 4 Dec 2013 12:32:47 +0000 Subject: [PATCH] Fixed bug in whitelist plugin with getting from address --- src/plugins/lua/whitelist.lua | 12 ++++++++---- 1 file 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 -- 2.39.5