diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-19 15:03:11 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-19 15:03:11 +0100 |
commit | 808a8d2f49e77b4339a4140b865ee9a671b209ef (patch) | |
tree | 4af7d2910a120c30b287c9b5ebc77ece373f47f1 /src/libmime | |
parent | 67de370681b5d2590609b7509f3899c99db89a84 (diff) | |
download | rspamd-808a8d2f49e77b4339a4140b865ee9a671b209ef.tar.gz rspamd-808a8d2f49e77b4339a4140b865ee9a671b209ef.zip |
[Fix] Rework settings to work properly in metric-less configuration
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/filter.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c index 7ed6ea010..b0f93ec4b 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -106,16 +106,14 @@ insert_metric_result (struct rspamd_task *task, } if (task->settings) { - mobj = ucl_object_lookup (task->settings, metric->name); - if (mobj) { - gdouble corr; - - sobj = ucl_object_lookup (mobj, symbol); - if (sobj != NULL && ucl_object_todouble_safe (sobj, &corr)) { - msg_debug ("settings: changed weight of symbol %s from %.2f to %.2f", - symbol, w, corr); - w = corr * flag; - } + mobj = task->settings; + gdouble corr; + + sobj = ucl_object_lookup (mobj, symbol); + if (sobj != NULL && ucl_object_todouble_safe (sobj, &corr)) { + msg_debug ("settings: changed weight of symbol %s from %.2f to %.2f", + symbol, w, corr); + w = corr * flag; } } |