commit 7242fd0: [Minor] Fix symbol name usage
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Nov 27 11:42:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-11-27 11:36:40 +0000
URL: https://github.com/rspamd/rspamd/commit/7242fd00f2e93c59dddeab0f7c36f92c515fd852
[Minor] Fix symbol name usage
---
src/plugins/lua/external_services.lua | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index 8e29accbe..37665378c 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -118,7 +118,6 @@ local function add_scanner_rule(sym, opts)
return nil
end
- if not opts.symbol then opts.symbol = sym:upper() end
local cfg = lua_scanners[opts.type]
if not cfg then
@@ -131,12 +130,15 @@ local function add_scanner_rule(sym, opts)
if not rule then
rspamd_logger.errx(rspamd_config, 'cannot configure %s for %s',
- opts.type, opts.symbol)
+ opts.type, rule.symbol or sym:upper())
return nil
end
rule.type = opts.type
-
+ -- Fill missing symbols
+ if not rule.symbol then
+ rule.symbol = sym:upper()
+ end
if not rule.symbol_fail then
rule.symbol_fail = rule.symbol .. '_FAIL'
end
@@ -183,8 +185,8 @@ local function add_scanner_rule(sym, opts)
end
end
- rspamd_logger.infox(rspamd_config, 'registered external services rule: %s',
- rule.name)
+ rspamd_logger.infox(rspamd_config, 'registered external services rule: symbol %s; type %s',
+ rule.symbol, rule.type)
return scan_cb, rule
end
More information about the Commits
mailing list