summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/fuzzy_check.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index b270191e6..980374c59 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -1775,6 +1775,7 @@ fuzzy_insert_result (struct fuzzy_client_session *session,
const gchar *symbol;
struct fuzzy_mapping *map;
struct rspamd_task *task = session->task;
+ double weight;
double nval;
guchar buf[2048];
const gchar *type = "bin";
@@ -1785,11 +1786,12 @@ fuzzy_insert_result (struct fuzzy_client_session *session,
GINT_TO_POINTER (rep->flag))) == NULL) {
/* Default symbol and default weight */
symbol = session->rule->symbol;
-
+ weight = session->rule->max_score;
}
else {
/* Get symbol and weight from map */
symbol = map->symbol;
+ weight = map->weight;
}
@@ -1799,8 +1801,7 @@ fuzzy_insert_result (struct fuzzy_client_session *session,
* Otherwise `value` means error code
*/
- nval = fuzzy_normalize (rep->value,
- session->rule->max_score);
+ nval = fuzzy_normalize (rep->value, weight);
if (io && (io->flags & FUZZY_CMD_FLAG_IMAGE)) {
nval *= rspamd_normalize_probability (rep->prob, 0.5);