diff options
-rw-r--r-- | src/libserver/cfg_file.h | 2 | ||||
-rw-r--r-- | src/libserver/symbols_cache.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 412cd4bb0..f724a82c8 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -279,8 +279,6 @@ struct rspamd_config { #ifdef WITH_GPERF_TOOLS gchar *profile_path; #endif - - gboolean accept_unknown_symbols; /**< if true unknown symbols are registered here */ gdouble unknown_weight; /**< weight of unknown symbols */ gdouble grow_factor; /**< grow factor for metric */ GHashTable *symbols; /**< weights of symbols in metric */ diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 9b8fba25b..719f8aabd 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1030,7 +1030,7 @@ rspamd_symbols_cache_validate_cb (gpointer k, gpointer v, gpointer ud) (SYMBOL_TYPE_NORMAL|SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_COMPOSITE|SYMBOL_TYPE_CLASSIFIER)) && g_hash_table_lookup (cfg->symbols, item->symbol) == NULL) { - if (cfg->accept_unknown_symbols) { + if (cfg->unknown_weight != 0) { skipped = FALSE; item->st->weight = cfg->unknown_weight; @@ -1043,14 +1043,17 @@ rspamd_symbols_cache_validate_cb (gpointer k, gpointer v, gpointer ud) msg_info_cache ("adding unknown symbol %s", item->symbol); ghost = FALSE; } + else { + skipped = TRUE; + } } else { skipped = FALSE; } - if (skipped) { + if (!ghost && skipped) { item->type |= SYMBOL_TYPE_SKIPPED; - msg_warn_cache ("symbol %s is not registered in any metric, so skip its check", + msg_warn_cache ("symbol %s has no score registered, skip its check", item->symbol); } |