aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-24 17:41:17 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-24 17:41:17 +0300
commit82afd88e2f092c86bdf629ab2ce794eae2bece5e (patch)
tree69a3e72b6eecddc0f957d5d771a47d3db60fc8a9 /src
parentbf1dbf9b0ff37fc7638aa09f035f5f98094c84e9 (diff)
downloadrspamd-82afd88e2f092c86bdf629ab2ce794eae2bece5e.tar.gz
rspamd-82afd88e2f092c86bdf629ab2ce794eae2bece5e.zip
Write to log if emails module find blacklisted email.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/emails.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua
index 641282c94..d72561dd0 100644
--- a/src/plugins/lua/emails.lua
+++ b/src/plugins/lua/emails.lua
@@ -32,6 +32,7 @@ end
function emails_dns_cb(task, to_resolve, results, err, symbol)
if results then
+ rspamd_logger.info('found host for: ' .. to_resolve .. ', insert symbol: ' .. symbol)
task:insert_result(symbol, 1)
end
end
@@ -48,12 +49,16 @@ function check_email_rule(task, rule, addr)
task:resolve_dns_a(to_resolve, 'emails_dns_cb', rule['symbol'])
elseif rule['map'] then
if rule['domain_only'] then
- if rule['map']:get_key(addr:get_host()) then
+ local key = addr:get_host()
+ if rule['map']:get_key(key) then
task:insert_result(rule['symbol'], 1)
+ rspamd_logger.info('email: ' .. key .. ' is found in list: ' .. rule['symbol'])
end
else
- if rule['map']:get_key(string.format('%s@%s', addr:get_user(), addr:get_host())) then
+ local key = string.format('%s@%s', addr:get_user(), addr:get_host())
+ if rule['map']:get_key(key) then
task:insert_result(rule['symbol'], 1)
+ rspamd_logger.info('email: ' .. key .. ' is found in list: ' .. rule['symbol'])
end
end
end