aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-05-24 15:34:32 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-05-24 15:34:32 +0100
commitf0c4d32740df0019673bc706c6004373a2a39220 (patch)
tree72d2d50cbd8737c3b879c53e7138618c7267edbe /src/libserver
parent08990def9860c586d9d9ec5a4e9865e3a9747aa4 (diff)
downloadrspamd-f0c4d32740df0019673bc706c6004373a2a39220.tar.gz
rspamd-f0c4d32740df0019673bc706c6004373a2a39220.zip
[Fix] Unset autolearn flag if we learn explicitly
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/task.c3
1 files changed, 3 insertions, 0 deletions
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;
}