]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow negative scores for no action pre-action
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Mar 2018 10:26:59 +0000 (10:26 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Mar 2018 10:26:59 +0000 (10:26 +0000)
src/libmime/filter.c

index fbd6d9f97f73e05d2b7f39374f5a0837e4d2db01..59765ea59a9a2759ae07e5829785bdce84059a93 100644 (file)
@@ -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;
+                       }
                }
        }