]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Imply LEFTMOST flag on regexps with conditions
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Sep 2023 14:55:23 +0000 (15:55 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Sep 2023 14:55:23 +0000 (15:55 +0100)
src/libmime/mime_expressions.c

index 20f2c754eec0f4572dfc0d4ec4f7c7df77989e3c..e51539ed0434ec34c8c4fc6adee1fe7a658d5948 100644 (file)
@@ -854,6 +854,9 @@ set:
 
                        if (lua_cbref != -1) {
                                msg_info_config("added condition for regexp %s", mime_atom->str);
+                               /* Add SOM_LEFTMOST_FLAG implicitly */
+                               rspamd_regexp_set_flags(mime_atom->d.re->regexp, rspamd_regexp_get_flags(mime_atom->d.re->regexp) |
+                                                                                                                                        RSPAMD_REGEXP_FLAG_LEFTMOST);
                        }
 
                        /* Register new item in the cache */