]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] If we have one statfile disabled we need to disable all 4932/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 19 Apr 2024 13:06:05 +0000 (14:06 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 19 Apr 2024 13:06:05 +0000 (14:06 +0100)
src/libstat/stat_process.c

index 7f62d4e2af7706324afaa68daf4040fa9390ec92..33b7053f86f7e5ceeafb1e72fcbb993c4a660814 100644 (file)
@@ -329,6 +329,18 @@ rspamd_stat_preprocess(struct rspamd_stat_ctx *st_ctx,
                        g_ptr_array_index(task->stat_runtimes, i) = NULL;
                        msg_debug_bayes("symbol %s is disabled, skip classification",
                                                        st->stcf->symbol);
+                       /* We need to disable the whole classifier for this! */
+                       struct rspamd_classifier *cl = st->classifier;
+                       for (int j = 0; j < st_ctx->statfiles->len; j++) {
+                               struct rspamd_statfile *nst = g_ptr_array_index(st_ctx->statfiles, j);
+
+                               if (st != nst && nst->classifier == cl) {
+                                       g_ptr_array_index(task->stat_runtimes, j) = NULL;
+                                       msg_debug_bayes("symbol %s is disabled, skip classification for %s as well",
+                                                                       st->stcf->symbol, nst->stcf->symbol);
+                               }
+                       }
+
                        continue;
                }