commit 473f029: [Minor] External_services: Fix fail symbol registration
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Oct 11 08:00:09 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-10-11 08:57:33 +0100
URL: https://github.com/rspamd/rspamd/commit/473f029ed5b38d5fb62e733cdbd1d896af39a25d (HEAD -> master)
[Minor] External_services: Fix fail symbol registration
---
src/plugins/lua/external_services.lua | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index d65a46a2c..0a9f39ad9 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -136,14 +136,8 @@ local function add_scanner_rule(sym, opts)
rule.type = opts.type
- if not opts.symbol_fail then
- opts.symbol_fail = opts.symbol .. '_FAIL'
- end
- if not opts.symbol_encrypted then
- opts.symbol_encrypted = opts.symbol .. '_ENCRYPTED'
- end
- if not opts.symbol_macro then
- opts.symbol_macro = opts.symbol .. '_MACRO'
+ if not rule.symbol_fail then
+ rule.symbol_fail = rule.symbol .. '_FAIL'
end
rule.redis_params = redis_params
@@ -220,13 +214,15 @@ if opts and type(opts) == 'table' then
local id = rspamd_config:register_symbol(t)
- rspamd_config:register_symbol({
- type = 'virtual',
- name = m['symbol_fail'],
- parent = id,
- score = 0.0,
- group = N
- })
+ if m.symbol_fail then
+ rspamd_config:register_symbol({
+ type = 'virtual',
+ name = m['symbol_fail'],
+ parent = id,
+ score = 0.0,
+ group = N
+ })
+ end
if m.symbol_encrypted then
rspamd_config:register_symbol({
More information about the Commits
mailing list