[Fix] Composites: Allow partial match

This commit is contained in:
Vsevolod Stakhov 2020-11-05 12:56:21 +00:00
parent 5ab536d145
commit 7c63add10c
3 changed files with 12 additions and 2 deletions

View File

@ -449,8 +449,8 @@ rspamd_composite_process_single_symbol (struct composites_data *cd,
}
}
else {
if (rspamd_regexp_match (cur_opt->data.re,
opt->option, opt->optlen, FALSE)) {
if (rspamd_regexp_search (cur_opt->data.re,
opt->option, opt->optlen, NULL, NULL, FALSE, NULL)) {
found = true;
break;

View File

@ -70,3 +70,9 @@ Composites - Opts RE Hit 2
Expect Symbol With Score SYMOPTS3 6.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS1
Composites - Opts RE Hit 3
Scan File ${MESSAGE} opts=example.com->app.link
Expect Symbol With Score SYMOPTS4 6.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS1

View File

@ -80,4 +80,8 @@ composites {
expression = 'OPTS[sym2,/FoO\\//i]';
score = 6.0;
}
SYMOPTS4 {
expression = 'POSITIVE_A & OPTS[/>app.link$/i] & EXPRESSIONS';
score = 6.0;
}
}