]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Unset autolearn flag if we learn explicitly
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 24 May 2024 14:34:32 +0000 (15:34 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 24 May 2024 14:34:32 +0000 (15:34 +0100)
src/libserver/task.c

index 6b349d3599df7cd5b2a595df155c955b3175ab89..63babf9908c1d527d9b0a00b5f242451b75ba779 100644 (file)
@@ -956,6 +956,9 @@ rspamd_learn_task_spam(struct rspamd_task *task,
                                           const char *classifier,
                                           GError **err)
 {
+       /* Disable learn auto flag to avoid bad learn codes */
+       task->flags &= ~RSPAMD_TASK_FLAG_LEARN_AUTO;
+
        if (is_spam) {
                task->flags |= RSPAMD_TASK_FLAG_LEARN_SPAM;
        }