diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-21 15:11:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-21 15:11:32 +0100 |
commit | 4653f1e9031133bcc9734a68b9e1c6a9a7cddd43 (patch) | |
tree | 03fee385f04bf30fc2b453ea487cf6d4d6eee256 /src | |
parent | 974f4532c11ad468c1392ffcdd62885b48a51f17 (diff) | |
download | rspamd-4653f1e9031133bcc9734a68b9e1c6a9a7cddd43.tar.gz rspamd-4653f1e9031133bcc9734a68b9e1c6a9a7cddd43.zip |
[Minor] Slightly improve logging
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/asn.lua | 9 | ||||
-rw-r--r-- | src/plugins/lua/emails.lua | 2 |
2 files changed, 6 insertions, 5 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 diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua index 51df0e959..5f076e1d5 100644 --- a/src/plugins/lua/emails.lua +++ b/src/plugins/lua/emails.lua @@ -52,7 +52,7 @@ local function check_email_rule(task, rule, addr) local function emails_dns_cb(_, _, results, err) if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then - logger.errx(task, 'Error querying DNS: %1', err) + logger.errx(task, 'Error querying DNS(%s): %s', to_resolve, err) elseif results then local expected_found = false local symbol = rule['symbol'] |