aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-28 15:45:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-28 15:45:28 +0100
commitc8f2ef32824fc404ad546838b10988ed527fa14d (patch)
tree364d36c0b464fd600c74329e805620c34246ad86 /src/plugins/lua
parent0379f1fb4efa5f6c6e9d1ab8ab73027cf79d7838 (diff)
downloadrspamd-c8f2ef32824fc404ad546838b10988ed527fa14d.tar.gz
rspamd-c8f2ef32824fc404ad546838b10988ed527fa14d.zip
[Fix] Improve multimap info message
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/multimap.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index f21bc5b11..4e3286796 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -359,7 +359,7 @@ local function multimap_callback(task, rule)
end
-- Parse result in form: <symbol>:<score>|<symbol>|<score>
- local function parse_ret(ret)
+ local function parse_ret(rule, ret)
if ret and type(ret) == 'string' then
local lpeg = require "lpeg"
local number = {}
@@ -403,7 +403,11 @@ local function multimap_callback(task, rule)
return true,sym,score
else
- rspamd_logger.infox(task, 'cannot parse %s', ret)
+ if ret ~= '' then
+ rspamd_logger.infox(task, '%s: cannot parse string "%s"',
+ rule.symbol, ret)
+ end
+
return true,nil,1.0
end
elseif type(ret) == 'boolean' then
@@ -417,7 +421,7 @@ local function multimap_callback(task, rule)
local function match_rule(r, value)
local function rule_callback(result)
if result then
- local res,symbol,score = parse_ret(result)
+ local res,symbol,score = parse_ret(r, result)
if symbol and r['symbols_set'] then
if not r['symbols_set'][symbol] then
rspamd_logger.infox(task, 'symbol %s is not registered for map %s, ' ..