summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-07-08 22:08:32 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-07-08 22:08:32 +0100
commit00ba1b52b7c59fb9d78b6dcd9b1dcd083625be2f (patch)
tree4df50e98e8ce41f684f61f421917bf4f0a6b89ef
parent7374691f84fd8e0cc64877ad6e42c6d8b3b784b8 (diff)
downloadrspamd-00ba1b52b7c59fb9d78b6dcd9b1dcd083625be2f.tar.gz
rspamd-00ba1b52b7c59fb9d78b6dcd9b1dcd083625be2f.zip
[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.
-rw-r--r--src/libserver/symcache/symcache_impl.cxx5
1 files changed, 1 insertions, 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) {