diff options
author | Jean-Louis Dupond <jean-louis@dupond.be> | 2017-08-11 14:32:58 +0200 |
---|---|---|
committer | Jean-Louis Dupond <jean-louis@dupond.be> | 2017-08-11 14:32:58 +0200 |
commit | 8455b9cc4f6ddfa9cc12c75894b4476bb36f14ed (patch) | |
tree | 0b9fd8e9758ff21ea7b1afb99eda75d70dd7984b /src/plugins/fuzzy_check.c | |
parent | 6f45464121b10a66e7fb2d5c4d2070739437daf2 (diff) | |
download | rspamd-8455b9cc4f6ddfa9cc12c75894b4476bb36f14ed.tar.gz rspamd-8455b9cc4f6ddfa9cc12c75894b4476bb36f14ed.zip |
[Fix] Use weight from map for fuzzy scoring
Diffstat (limited to 'src/plugins/fuzzy_check.c')
-rw-r--r-- | src/plugins/fuzzy_check.c | 7 |
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); |