This fixes an issue where composite rules depending on statistics symbols
(like BAYES_SPAM) would fail to trigger. The nresults_postfilters counter
was being set too early (after COMPOSITES stage), preventing detection of
symbols added during autolearn or other post-filter processing.
Fixes #5674
case RSPAMD_TASK_STAGE_COMPOSITES:
rspamd_composites_process_task(task);
- task->result->nresults_postfilters = task->result->nresults;
break;
case RSPAMD_TASK_STAGE_POST_FILTERS:
!(task->flags & (RSPAMD_TASK_FLAG_LEARN_SPAM | RSPAMD_TASK_FLAG_LEARN_HAM | RSPAMD_TASK_FLAG_LEARN_CLASS))) {
rspamd_stat_check_autolearn(task);
}
+
+ if (all_done) {
+ /* Record results count after postfilters to detect if learning stages add symbols */
+ task->result->nresults_postfilters = task->result->nresults;
+ }
break;
case RSPAMD_TASK_STAGE_LEARN: