From 8cf694d95480986570ef09057707c6a52cd5fa90 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 20 Mar 2022 17:32:34 +0000 Subject: [PATCH] [Minor] Allow to disable composites without config breaking Issue: #4078 --- src/libserver/cfg_rcl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index aa50cbe42..8619fcc5e 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -1373,6 +1373,12 @@ rspamd_rcl_composite_handler (rspamd_mempool_t *pool, composite_name = key; + const ucl_object_t *val = ucl_object_lookup(obj, "enabled"); + if (val != NULL && !ucl_object_toboolean(val)) { + msg_info_config ("composite %s is disabled", composite_name); + return TRUE; + } + if ((composite = rspamd_composites_manager_add_from_ucl(cfg->composites_manager, composite_name, obj)) != NULL) { rspamd_symcache_add_symbol (cfg->cache, composite_name, 0, -- 2.39.5