diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-04 16:35:41 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-04 16:35:41 +0000 |
commit | 5e58080132b976ff5949a6cc763e8d59d569fa6a (patch) | |
tree | de7493cb7dac3cf9262d9ed4e509194389afa588 | |
parent | 47a97183b957e6b16851a02a7d1b7eafe8e99b4f (diff) | |
parent | 625d9161305393d89679650fe616707a4c090797 (diff) | |
download | rspamd-5e58080132b976ff5949a6cc763e8d59d569fa6a.tar.gz rspamd-5e58080132b976ff5949a6cc763e8d59d569fa6a.zip |
Merged in simonpin/rspamd (pull request #1)
Fixed bug in whitelist plugin with getting from address
-rw-r--r-- | src/plugins/lua/whitelist.lua | 12 |
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 |