summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-21 17:24:24 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-21 17:24:24 +0000
commit532914ab6ccbff8ab1105e7883d2ea008858bd5a (patch)
tree498083abb5a1df854bfad1036eec80bcb8b2bd3d
parent76c5efd475df0d311f1217ec10140cc25426dd0a (diff)
downloadrspamd-532914ab6ccbff8ab1105e7883d2ea008858bd5a.tar.gz
rspamd-532914ab6ccbff8ab1105e7883d2ea008858bd5a.zip
[Minor] Fix some issues when dealing with scores
-rw-r--r--src/libmime/filter.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index ed949a86a..9d094d9ac 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -77,7 +77,7 @@ rspamd_check_group_score (struct rspamd_task *task,
gdouble *group_score,
gdouble w)
{
- if (gr != NULL && group_score && gr->max_score > 0.0) {
+ if (gr != NULL && group_score && gr->max_score > 0.0 && w > 0.0) {
if (*group_score >= gr->max_score && w > 0) {
msg_info_task ("maximum group score %.2f for group %s has been reached,"
" ignoring symbol %s with weight %.2f", gr->max_score,
@@ -165,9 +165,6 @@ insert_metric_result (struct rspamd_task *task,
}
else {
s->nshots ++;
- }
-
- if (!single) {
rspamd_task_add_result_option (task, s, opt);
}
@@ -176,7 +173,7 @@ insert_metric_result (struct rspamd_task *task,
diff = w;
}
else {
- if (fabs (s->score) < fabs (w)) {
+ if (fabs (s->score) < fabs (w) && signbit (s->score) == signbit (w)) {
/* Replace less weight with a bigger one */
diff = metric_res->score - s->score + w;
}