]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add implicit header type for regexps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Sep 2018 09:00:55 +0000 (10:00 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Sep 2018 09:06:29 +0000 (10:06 +0100)
src/libmime/mime_expressions.c

index bd1c8cb0014b5086c884644dec9fa547deb9287d..bbbdaff044be90f9c9cdbfaa4ab42c95f7ca634a 100644 (file)
@@ -433,8 +433,15 @@ rspamd_mime_expr_parse_regexp_atom (rspamd_mempool_t * pool, const gchar *line,
        }
 
        if (result->type >= RSPAMD_RE_MAX) {
-               msg_err_pool ("could not read regexp: %s, unknown type", src);
-               return NULL;
+               if (extra) {
+                       /* Assume header regexp */
+                       result->extra.header = extra;
+                       result->type = RSPAMD_RE_HEADER;
+               }
+               else {
+                       msg_err_pool ("could not read regexp: %s, unknown type", src);
+                       return NULL;
+               }
        }
 
        if ((result->type == RSPAMD_RE_HEADER ||