aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-27 14:47:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-27 14:47:31 +0100
commit4685cc5b83bc5240aa15e77b6314bdda8853cb8a (patch)
tree545286115116b4535c06c6dcc5cc040902664dfd
parentd4b650a68c1502f2fe0aa910f5bad6eee0f6e11a (diff)
downloadrspamd-4685cc5b83bc5240aa15e77b6314bdda8853cb8a.tar.gz
rspamd-4685cc5b83bc5240aa15e77b6314bdda8853cb8a.zip
[Minor] Fix expressions priorities
-rw-r--r--src/libmime/mime_expressions.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index 06b590f51..dfeeaf9ac 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -1060,25 +1060,31 @@ rspamd_mime_expr_priority (rspamd_expression_atom_t *atom)
switch (mime_atom->type) {
case MIME_ATOM_INTERNAL_FUNCTION:
/* Prioritize internal functions slightly */
- ret = 50;
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 8;
break;
case MIME_ATOM_LUA_FUNCTION:
case MIME_ATOM_LOCAL_LUA_FUNCTION:
- ret = 50;
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 4;
break;
case MIME_ATOM_REGEXP:
switch (mime_atom->d.re->type) {
case RSPAMD_RE_HEADER:
case RSPAMD_RE_RAWHEADER:
- ret = 100;
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 16;
break;
case RSPAMD_RE_URL:
case RSPAMD_RE_EMAIL:
- ret = 90;
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 8;
+ break;
+ case RSPAMD_RE_SELECTOR:
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 8;
break;
case RSPAMD_RE_MIME:
case RSPAMD_RE_RAWMIME:
- ret = 10;
+ case RSPAMD_RE_WORDS:
+ case RSPAMD_RE_RAWWORDS:
+ case RSPAMD_RE_STEMWORDS:
+ ret = RSPAMD_EXPRESSION_MAX_PRIORITY - RSPAMD_EXPRESSION_MAX_PRIORITY / 2;
break;
default:
/* For message regexp */