diff options
-rw-r--r-- | src/expressions.c | 3 | ||||
-rw-r--r-- | test/rspamd_expression_test.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/expressions.c b/src/expressions.c index c1cd8c0bd..e706fc938 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -277,6 +277,9 @@ parse_expression (memory_pool_t *pool, char *line) insert_expression (pool, &expr, EXPR_OPERATION, op, NULL); } } + if (stack) { + op = delete_expression_stack (&stack); + } } else if (*p == '(') { /* Push it to stack */ diff --git a/test/rspamd_expression_test.c b/test/rspamd_expression_test.c index 7b723e9e6..d49cb4ac1 100644 --- a/test/rspamd_expression_test.c +++ b/test/rspamd_expression_test.c @@ -9,6 +9,7 @@ char *test_expressions[] = { "(A&B|!C)&!(D|E)", "/test&!/&!/\\/|/", "header_exists(f(b(aaa)))|header=/bbb/", + "!(header_exists(X-Mailer) | header_exists(User-Agent)) & Received=/cp-out\\d+\\.libero\\.it/H & Message-Id=/<[\\da-f]{12}\\.[\\da-f]{16}@/H", NULL }; |