From: Simon Pin Date: Wed, 4 Dec 2013 12:32:47 +0000 (+0000) Subject: Fixed bug in whitelist plugin with getting from address X-Git-Tag: 0.6.2~21^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=625d9161305393d89679650fe616707a4c090797;p=rspamd.git Fixed bug in whitelist plugin with getting from address --- 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