]> source.dussan.org Git - rspamd.git/commitdiff
Honor one_shot setting for symbols.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Oct 2014 00:11:28 +0000 (01:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Oct 2014 00:11:28 +0000 (01:11 +0100)
src/libmime/filter.c

index c7258f1bfd1b40d0ce781df56cda8064b8b30410..09188783958f05a26121eb8c5b18be5e0b69bd5b 100644 (file)
@@ -138,6 +138,13 @@ insert_metric_result (struct rspamd_task *task,
 
        /* Add metric score */
        if ((s = g_hash_table_lookup (metric_res->symbols, symbol)) != NULL) {
+               if (sdef && sdef->one_shot) {
+                       /*
+                        * For one shot symbols we do not need to add them again, so
+                        * we just force single behaviour here
+                        */
+                       single = TRUE;
+               }
                if (s->options && opts && opts != s->options) {
                        /* Append new options */
                        s->options = g_list_concat (s->options, g_list_copy (opts));