aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/asn.lua
diff options
context:
space:
mode:
authorheraklit256 <37872459+heraklit256@users.noreply.github.com>2018-05-21 16:48:31 +0000
committerGitHub <noreply@github.com>2018-05-21 16:48:31 +0000
commit109730f3834c0aa7fedc8315406793b1d2a5f530 (patch)
tree03fee385f04bf30fc2b453ea487cf6d4d6eee256 /src/plugins/lua/asn.lua
parentb11a405d7a547f8f34050c733d3db2fc8b5d04ca (diff)
parent4653f1e9031133bcc9734a68b9e1c6a9a7cddd43 (diff)
downloadrspamd-109730f3834c0aa7fedc8315406793b1d2a5f530.tar.gz
rspamd-109730f3834c0aa7fedc8315406793b1d2a5f530.zip
Merge pull request #1 from vstakhov/master
merge current rspamd into local repo
Diffstat (limited to 'src/plugins/lua/asn.lua')
-rw-r--r--src/plugins/lua/asn.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/lua/asn.lua b/src/plugins/lua/asn.lua
index 3e84a3824..61572a600 100644
--- a/src/plugins/lua/asn.lua
+++ b/src/plugins/lua/asn.lua
@@ -60,18 +60,19 @@ local function asn_check(task)
local asn_check_func = {}
function asn_check_func.rspamd(ip)
+ local dnsbl = options['provider_info']['ip' .. ip:get_version()]
+ local req_name = rspamd_logger.slog("%1.%2",
+ table.concat(ip:inversed_str_octets(), '.'), dnsbl)
local function rspamd_dns_cb(_, _, results, dns_err)
if dns_err and (dns_err ~= 'requested record is not found' and dns_err ~= 'no records with this name') then
- rspamd_logger.errx(task, 'error querying dns: %s', dns_err)
+ rspamd_logger.errx(task, 'error querying dns (%s): %s', req_name, dns_err)
end
if not (results and results[1]) then return end
local parts = rspamd_re:split(results[1])
-- "15169 | 8.8.8.0/24 | US | arin |" for 8.8.8.8
asn_set(parts[1], parts[2], parts[3])
end
- local dnsbl = options['provider_info']['ip' .. ip:get_version()]
- local req_name = rspamd_logger.slog("%1.%2",
- table.concat(ip:inversed_str_octets(), '.'), dnsbl)
+
task:get_resolver():resolve_txt(task:get_session(), task:get_mempool(),
req_name, rspamd_dns_cb)
end