/* Check whether this item is skipped */
skipped = !ghost;
- if (!item->is_callback && pcache->cfg &&
+ if (!ghost && !item->is_callback && pcache->cfg &&
g_hash_table_lookup (pcache->cfg->metrics_symbols, name) == NULL) {
cur = g_list_first (pcache->cfg->metrics_list);
while (cur) {
-- Now check all valid rules and add the according rspamd rules
+local function calculate_score(sym)
+ if _.all(function(c) return c == '_' end, _.take_n(2, _.iter(sym))) then
+ return 0.0
+ end
+
+ return 1.0
+end
+
-- Meta rules
_.each(function(k, r)
rspamd_config:add_composite(k, r['meta'])
end
end
end
- rspamd_config:register_symbol(k, 1.0, f)
+ rspamd_config:register_symbol(k, calculate_score(k), f)
if r['score'] then
rspamd_config:set_metric_symbol(k, r['score'], r['description'])
end
end
end
end
- rspamd_config:register_symbol(k, 1.0, f)
+ rspamd_config:register_symbol(k, calculate_score(k), f)
if r['score'] then
rspamd_config:set_metric_symbol(k, r['score'], r['description'])
end
return
end
end
- rspamd_config:register_symbol(k, 1.0, f)
+ rspamd_config:register_symbol(k, calculate_score(k), f)
if r['score'] then
rspamd_config:set_metric_symbol(k, r['score'], r['description'])
end