aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-22 17:45:16 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-22 17:45:16 +0000
commita499ed1c7b71badd986d529d04d7680af8ed0a61 (patch)
treeba3ba7c6c451451ea25c9325f61d7f0b40cd34db /src/plugins/lua
parent5c634505b897822e110c32afe33d3ef2f55444cb (diff)
downloadrspamd-a499ed1c7b71badd986d529d04d7680af8ed0a61.tar.gz
rspamd-a499ed1c7b71badd986d529d04d7680af8ed0a61.zip
Fix issue when SA metas contain other metas
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/spamassassin.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index f0243acfa..08abb7b05 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