aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-11-02 21:17:01 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-11-02 21:18:31 +0000
commit0449b56df04b3d55e6f7d3738ae1040ba595af47 (patch)
tree888c1a02bdb445d2c38be130486d11bbea7e8327 /src
parent853d1774f7267c9a64e271e683257a8f3ff9de0d (diff)
downloadrspamd-0449b56df04b3d55e6f7d3738ae1040ba595af47.tar.gz
rspamd-0449b56df04b3d55e6f7d3738ae1040ba595af47.zip
[Fix] Honor group flag for one shot
Diffstat (limited to 'src')
-rw-r--r--src/libmime/scan_result.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libmime/scan_result.c b/src/libmime/scan_result.c
index 33cac5f70..137f30ca0 100644
--- a/src/libmime/scan_result.c
+++ b/src/libmime/scan_result.c
@@ -236,7 +236,7 @@ insert_metric_result (struct rspamd_task *task,
struct rspamd_symbol *sdef;
struct rspamd_symbols_group *gr = NULL;
const ucl_object_t *mobj, *sobj;
- gint max_shots, ret;
+ gint max_shots = G_MAXINT, ret;
guint i;
khiter_t k;
gboolean single = !!(flags & RSPAMD_SYMBOL_INSERT_SINGLE);
@@ -322,7 +322,16 @@ insert_metric_result (struct rspamd_task *task,
max_shots = sdef->nshots;
}
else {
- max_shots = task->cfg->default_max_shots;
+ if (sdef->groups) {
+ PTR_ARRAY_FOREACH(sdef->groups, i, gr) {
+ if (gr->flags & RSPAMD_SYMBOL_GROUP_ONE_SHOT) {
+ max_shots = 1;
+ }
+ }
+ }
+ else {
+ max_shots = task->cfg->default_max_shots;
+ }
}
}