diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-02 20:23:16 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-02 20:23:16 +0400 |
commit | ce482fbf8e2c1b9bf0cdba0ab61bc26985ee8977 (patch) | |
tree | aa9db8b8c40ce43d504750f03f781652c16ea727 /src/filter.c | |
parent | f3ad9c6f1e91c9912dbe730fdec350b5fc908672 (diff) | |
download | rspamd-ce482fbf8e2c1b9bf0cdba0ab61bc26985ee8977.tar.gz rspamd-ce482fbf8e2c1b9bf0cdba0ab61bc26985ee8977.zip |
* Add reject score setting for hard rejecting of mail (by Anton Nekhoroshin)
* Add rspamc protocol 1.1 (3 marks instead of 2)
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/filter.c b/src/filter.c index 0ffec02d5..efda9fa72 100644 --- a/src/filter.c +++ b/src/filter.c @@ -234,12 +234,12 @@ static gboolean check_metric_is_spam (struct worker_task *task, struct metric *metric) { struct metric_result *res; - double ms; + double ms, rs; res = g_hash_table_lookup (task->results, metric->name); if (res) { metric_process_callback_forced (metric->name, res, task); - if (!check_metric_settings (task, metric, &ms)) { + if (!check_metric_settings (task, metric, &ms, &rs)) { ms = metric->required_score; } return res->score >= ms; @@ -572,18 +572,18 @@ insert_metric_header (gpointer metric_name, gpointer metric_value, gpointer data char header_name[128], outbuf[1000]; GList *symbols = NULL, *cur; struct metric_result *metric_res = (struct metric_result *)metric_value; - double ms; + double ms, rs; snprintf (header_name, sizeof (header_name), "X-Spam-%s", metric_res->metric->name); - if (!check_metric_settings (task, metric_res->metric, &ms)) { + if (!check_metric_settings (task, metric_res->metric, &ms, &rs)) { ms = metric_res->metric->required_score; } if (metric_res->score >= ms) { - r += snprintf (outbuf + r, sizeof (outbuf) - r, "yes; %.2f/%.2f; ", metric_res->score, ms); + r += snprintf (outbuf + r, sizeof (outbuf) - r, "yes; %.2f/%.2f/%.2f; ", metric_res->score, ms, rs); } else { - r += snprintf (outbuf + r, sizeof (outbuf) - r, "no; %.2f/%.2f; ", metric_res->score, ms); + r += snprintf (outbuf + r, sizeof (outbuf) - r, "no; %.2f/%.2f/%.2f; ", metric_res->score, ms, rs); } symbols = g_hash_table_get_keys (metric_res->symbols); |