]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to disable composites without config breaking
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 17:32:34 +0000 (17:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 17:32:34 +0000 (17:32 +0000)
Issue: #4078

src/libserver/cfg_rcl.c

index aa50cbe42b70a24778db154acc4e4053f4ae73a3..8619fcc5e965340b4b79d510072a81e0c11c7107 100644 (file)
@@ -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,