]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix issue when SA metas contain other metas
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Dec 2015 17:45:16 +0000 (17:45 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Dec 2015 17:45:16 +0000 (17:45 +0000)
src/plugins/lua/spamassassin.lua

index f0243acfa273ea8ef7cd01d7f1f34951e774f583..08abb7b056e3171bd411006e832292ed63454dc2 100644 (file)
@@ -1218,11 +1218,14 @@ local function post_process()
       -- Meta function callback
       local meta_cb = function(task)
         local res = 0
-        if expression then
-          res = expression:process(task)
-        end
-        if res > 0 then
-          task:insert_result(k, res)
+        -- XXX: need to memoize result for better performance
+        if not task:get_symbol(k) then
+          if expression then
+            res = expression:process(task)
+          end
+          if res > 0 then
+            task:insert_result(k, res)
+          end
         end
 
         return res