diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-23 12:39:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-23 12:39:34 +0100 |
commit | 2ee4ab715eadeaba2a23dcf44d5a93ad082e1b4b (patch) | |
tree | 56b2a466c06d8ca8556281120bee2779d530ca20 /src | |
parent | c13572372d95a5c290a1c51a5b4e90923be10c0d (diff) | |
download | rspamd-2ee4ab715eadeaba2a23dcf44d5a93ad082e1b4b.tar.gz rspamd-2ee4ab715eadeaba2a23dcf44d5a93ad082e1b4b.zip |
[Minor] Spamassassin: Exclude symbol name from options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 2e34201a4..2ba0b6228 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -1466,14 +1466,19 @@ local function post_process() local res = 0 local trace = {} -- XXX: need to memoize result for better performance - local sym = task:has_symbol(k) - if not sym then + local has_sym = task:has_symbol(k) + if not has_sym then if expression then res,trace = expression:process_traced(task) end if res > 0 then -- Symbol should be one shot to make it working properly - task:insert_result(k, res, trace) + + -- Exclude elements that are named in the same way as the symbol itself + local function exclude_sym_filter(sopt) + return sopt ~= k + end + task:insert_result(k, res, fun.totable(fun.filter(exclude_sym_filter, trace))) end else res = 1 |