aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/expressions.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/expressions.c b/src/expressions.c
index 2d564aa22..641cc6dc4 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -1044,8 +1044,18 @@ rspamd_parts_distance (struct worker_task * task, GList * args, void *unused)
if ((pdiff = memory_pool_get_variable (task->task_pool, "parts_distance")) != NULL) {
diff = *pdiff;
- if (diff != -1 && diff <= threshold) {
- return TRUE;
+ if (diff != -1) {
+ if (threshold2 > 0) {
+ if (diff >= MIN (threshold, threshold2) && diff <= MAX (threshold, threshold2)) {
+ return TRUE;
+ }
+ }
+ else {
+ if (diff <= threshold) {
+ return TRUE;
+ }
+ }
+ return FALSE;
}
else {
return FALSE;