aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/spamassassin.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-01 14:06:05 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-01 14:06:05 +0000
commitfe0b31d91e4228f4b3ff1a3b5b26c34954528de2 (patch)
treecd35b32862539e20d7624b0e1c3226990fd730a9 /src/plugins/lua/spamassassin.lua
parent25cc03459a73491b7c301d5ef9eed2b2f21cbc3c (diff)
downloadrspamd-fe0b31d91e4228f4b3ff1a3b5b26c34954528de2.tar.gz
rspamd-fe0b31d91e4228f4b3ff1a3b5b26c34954528de2.zip
[Fix] Yet another change for testing external deps
Diffstat (limited to 'src/plugins/lua/spamassassin.lua')
-rw-r--r--src/plugins/lua/spamassassin.lua29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index b4c504a3e..fc23707d9 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -1143,27 +1143,16 @@ local function process_atom(atom, task)
end
return res
else
- local ext_dep = external_deps[atom]
- if ext_dep then
- local res = 0
-
- if type(ext_dep) == 'number' then
- if task:has_symbol(atom) then
- res = 1
- end
- elseif type(ext_dep) == 'string' then
- -- Apply replacement
- if task:has_symbol(ext_dep) then
- res = 1
- end
- end
-
- rspamd_logger.debugm(N, task, 'external atom: %1, result: %2', atom, res)
-
- return res
- else
- rspamd_logger.debugm(N, task, 'Cannot find atom ' .. atom)
+ -- This is likely external atom
+ local real_sym = atom
+ if symbols_replacements[atom] then
+ real_sym = symbols_replacements[atom]
+ end
+ if task:has_symbol(real_sym) then
+ rspamd_logger.debugm(N, task, 'external atom: %1, result: 1', real_sym)
+ return 1
end
+ rspamd_logger.debugm(N, task, 'external atom: %1, result: 0', real_sym)
end
return 0
end