From: Vsevolod Stakhov Date: Tue, 22 Dec 2015 17:45:16 +0000 (+0000) Subject: Fix issue when SA metas contain other metas X-Git-Tag: 1.1.0~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a499ed1c7b71badd986d529d04d7680af8ed0a61;p=thirdparty%2Frspamd.git Fix issue when SA metas contain other metas --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index f0243acfa2..08abb7b056 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -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