aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/whitelist.lua
diff options
context:
space:
mode:
authorSimon Pin <simon.pin@mail.com>2013-12-04 12:32:47 +0000
committerSimon Pin <simon.pin@mail.com>2013-12-04 12:32:47 +0000
commit625d9161305393d89679650fe616707a4c090797 (patch)
treebad42f1845463f75acb5f2849a45db64e66a4cb1 /src/plugins/lua/whitelist.lua
parentaaaf1af4b7f5406d4db3f2299de8767ec3dab36b (diff)
downloadrspamd-625d9161305393d89679650fe616707a4c090797.tar.gz
rspamd-625d9161305393d89679650fe616707a4c090797.zip
Fixed bug in whitelist plugin with getting from address
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