From: Vsevolod Stakhov Date: Thu, 15 Mar 2018 10:26:59 +0000 (+0000) Subject: [Minor] Allow negative scores for no action pre-action X-Git-Tag: 1.7.1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ea28fcae880df9f2af0f694d49174dd30793548;p=thirdparty%2Frspamd.git [Minor] Allow negative scores for no action pre-action --- diff --git a/src/libmime/filter.c b/src/libmime/filter.c index fbd6d9f97f..59765ea59a 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -389,10 +389,12 @@ rspamd_check_action_metric (struct rspamd_task *task, struct rspamd_metric_resul } if (!isnan (sc)) { - mres->score = sc; - } - else { - mres->score = 0; + if (task->pre_result.action == METRIC_ACTION_NOACTION) { + mres->score = MIN (sc, mres->score); + } + else { + mres->score = sc; + } } }