From 20f6d7103e0526de6c8e74d2565e8c399fceacc7 Mon Sep 17 00:00:00 2001 From: aduernberger Date: Thu, 18 Apr 2024 14:28:34 +0200 Subject: [PATCH] [Fix] Always set the unlearn flag when relearning Treat relearning from ham to spam the same as relearning from spam to ham. `res` is only set to true if the mail is already learned. --- src/libstat/learn_cache/redis_cache.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstat/learn_cache/redis_cache.cxx b/src/libstat/learn_cache/redis_cache.cxx index 15dccf141..0de5cd094 100644 --- a/src/libstat/learn_cache/redis_cache.cxx +++ b/src/libstat/learn_cache/redis_cache.cxx @@ -170,7 +170,7 @@ rspamd_stat_cache_checked(lua_State *L) (task->flags & RSPAMD_TASK_FLAG_LEARN_SPAM) ? "spam" : "ham"); task->flags |= RSPAMD_TASK_FLAG_ALREADY_LEARNED; } - else if (val != 0) { + else { /* Unlearn flag */ task->flags |= RSPAMD_TASK_FLAG_UNLEARN; } -- 2.39.5