From: aduernberger Date: Thu, 18 Apr 2024 12:28:34 +0000 (+0200) Subject: [Fix] Always set the unlearn flag when relearning X-Git-Tag: 3.9.0~65^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20f6d7103e0526de6c8e74d2565e8c399fceacc7;p=thirdparty%2Frspamd.git [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. --- diff --git a/src/libstat/learn_cache/redis_cache.cxx b/src/libstat/learn_cache/redis_cache.cxx index 15dccf1419..0de5cd0941 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; }