Browse Source

[Minor] Some debug logging for RBL module

tags/1.4.1
Andrew Lewis 7 years ago
parent
commit
c22f1ab8bb
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      src/plugins/lua/rbl.lua

+ 8
- 1
src/plugins/lua/rbl.lua View File

@@ -65,7 +65,12 @@ local function rbl_cb (task)
if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then
rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, err)
end
if not results then return end
if not results then
rspamd_logger.debugx(task, 'DNS RESPONSE: label=%1 results=%2 error=%3 rbl=%4', to_resolve, false, err, rule['rbls'][1]['symbol'])
return
else
rspamd_logger.debugx(task, 'DNS RESPONSE: label=%1 results=%2 error=%3 rbl=%4', to_resolve, true, err, rule['rbls'][1]['symbol'])
end

for _,rbl in ipairs(rule.rbls) do
if rbl['returncodes'] == nil and rbl['symbol'] ~= nil then
@@ -75,6 +80,7 @@ local function rbl_cb (task)
for _,result in pairs(results) do
local ipstr = result:to_string()
local foundrc
rspamd_logger.debugx(task, '%s DNS result %s', to_resolve, ipstr)
for s,i in pairs(rbl['returncodes']) do
if type(i) == 'string' then
if string.find(ipstr, '^' .. i .. '$') then
@@ -110,6 +116,7 @@ local function rbl_cb (task)
local params = {} -- indexed by rbl name

local function gen_rbl_rule(to_resolve, rbl)
rspamd_logger.debugx(task, 'DNS REQUEST: label=%1 rbl=%2', to_resolve, rbl['symbol'])
if not params[to_resolve] then
local nrule = {
to_resolve = to_resolve,

Loading…
Cancel
Save