]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix multimap content filters
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Aug 2016 10:20:41 +0000 (11:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Aug 2016 10:23:34 +0000 (11:23 +0100)
src/plugins/lua/multimap.lua

index e40cb01ccf10842b60caad84764cc3fac77061ff..92fbe9e4cbc1b133260f22b6bc27cf94b6af05f1 100644 (file)
@@ -197,7 +197,7 @@ local function apply_filename_filter(filter, fn, r)
   return fn
 end
 
-local function apply_content_filter(filter, r)
+local function apply_content_filter(task, filter, r)
   if filter == 'body' then
     return {task:get_rawbody()}
   elseif filter == 'full' then
@@ -347,7 +347,7 @@ local function multimap_callback(task, rule)
     local function rule_callback(result)
       if result then
         local res,symbol,score = parse_ret(result)
-        if symbol then
+        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, ' ..
               'replace it with just %s',
@@ -417,7 +417,7 @@ local function multimap_callback(task, rule)
     local data = {}
 
     if r['filter'] then
-      data = apply_content_filter(r['filter'], r)
+      data = apply_content_filter(task, r['filter'], r)
     else
       data = {task:get_content()}
     end