commit 00ba1b5: [Fix] Remove check for a score with no symbol being registered

Vsevolod Stakhov vsevolod at rspamd.com
Fri Jul 8 21:14:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-07-08 22:08:32 +0100
URL: https://github.com/rspamd/rspamd/commit/00ba1b52b7c59fb9d78b6dcd9b1dcd083625be2f (HEAD -> master)

[Fix] Remove check for a score with no symbol being registered
This check is redundant and has proven to confuse users who want to disable some rules.
Indeed, if we are looking for a way to hint a user that the registered symbol `example`
does not match with the scored symbol `exmaple` (e.g. incorrect spelling), then this
error will be detected when we match symcache entries and the scores. The opposite check
is useless to prevent such an error. And since it is much harder to define a dangling score
with no real symbol, we can just ignore this possibility in general, since the FP for this check,
specifically when some rule got intentionally disabled but a score is not removed just annoys
users for no good reason.

---
 src/libserver/symcache/symcache_impl.cxx | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/libserver/symcache/symcache_impl.cxx b/src/libserver/symcache/symcache_impl.cxx
index 7a6878faa..77f7ea19f 100644
--- a/src/libserver/symcache/symcache_impl.cxx
+++ b/src/libserver/symcache/symcache_impl.cxx
@@ -815,13 +815,10 @@ auto symcache::validate(bool strict) -> bool
 
 		if (!ignore_symbol) {
 			if (!items_by_symbol.contains((const char *) k)) {
-				msg_warn_cache (
+				msg_debug_cache (
 						"symbol '%s' has its score defined but there is no "
 						"corresponding rule registered",
 						k);
-				if (strict) {
-					ret = FALSE;
-				}
 			}
 		}
 		else if (sym_def->flags & RSPAMD_SYMBOL_FLAG_DISABLED) {


More information about the Commits mailing list