commit 20f6d71: [Fix] Always set the unlearn flag when relearning
GitHub
noreply at github.com
Mon Jul 29 17:55:45 UTC 2024
Author: aduernberger
Date: 2024-04-18 14:28:34 +0200
URL: https://github.com/rspamd/rspamd/commit/20f6d7103e0526de6c8e74d2565e8c399fceacc7
[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;
}
More information about the Commits
mailing list