diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-27 11:36:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-27 11:36:40 +0000 |
commit | 7242fd00f2e93c59dddeab0f7c36f92c515fd852 (patch) | |
tree | 8b8da2e42867e03f380aa98c1284250794070bc6 | |
parent | 8cc76b5f2fde9e664221832ab414c23ac9af3dfd (diff) | |
download | rspamd-7242fd00f2e93c59dddeab0f7c36f92c515fd852.tar.gz rspamd-7242fd00f2e93c59dddeab0f7c36f92c515fd852.zip |
[Minor] Fix symbol name usage
-rw-r--r-- | src/plugins/lua/external_services.lua | 12 |
1 files 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 |