From f0c4d32740df0019673bc706c6004373a2a39220 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 24 May 2024 15:34:32 +0100 Subject: [PATCH] [Fix] Unset autolearn flag if we learn explicitly --- src/libserver/task.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libserver/task.c b/src/libserver/task.c index 6b349d359..63babf990 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -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; } -- 2.39.5