aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-16 10:00:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-16 10:06:29 +0100
commitca18e04ce01e4c2782f1cf49a8572c03dec155cc (patch)
tree23236cefb1e12a7c6e825ba7115c3fc4fdc99961 /src/libmime
parentce1dbec019d7ab776d89884f09a55e83f5461732 (diff)
downloadrspamd-ca18e04ce01e4c2782f1cf49a8572c03dec155cc.tar.gz
rspamd-ca18e04ce01e4c2782f1cf49a8572c03dec155cc.zip
[Minor] Add implicit header type for regexps
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/mime_expressions.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index bd1c8cb00..bbbdaff04 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -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 ||