diff options
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/re_cache.c | 10 | ||||
-rw-r--r-- | src/libserver/re_cache.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index f38b254ef..da25040f8 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -633,6 +633,7 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, rspamd_regexp_get_pattern (re), ret); break; case RSPAMD_RE_MIME: + case RSPAMD_RE_RAWMIME: /* Iterate throught text parts */ for (i = 0; i < task->text_parts->len; i++) { part = g_ptr_array_index (task->text_parts, i); @@ -647,9 +648,10 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, raw = TRUE; } /* Select data for regexp */ - if (raw) { + if (re_class->type == RSPAMD_RE_RAWMIME) { in = part->orig->data; len = part->orig->len; + raw = TRUE; } else { in = part->content->data; @@ -820,6 +822,9 @@ rspamd_re_cache_type_to_string (enum rspamd_re_type type) case RSPAMD_RE_MIME: ret = "part"; break; + case RSPAMD_RE_RAWMIME: + ret = "raw part"; + break; case RSPAMD_RE_BODY: ret = "rawbody"; break; @@ -849,6 +854,9 @@ rspamd_re_cache_type_from_string (const char *str) else if (strcmp (str, "mime") == 0) { ret = RSPAMD_RE_MIME; } + else if (strcmp (str, "rawmime") == 0) { + ret = RSPAMD_RE_RAWMIME; + } else if (strcmp (str, "body") == 0) { ret = RSPAMD_RE_BODY; } diff --git a/src/libserver/re_cache.h b/src/libserver/re_cache.h index 0fffc2d7c..1f0ab7c9b 100644 --- a/src/libserver/re_cache.h +++ b/src/libserver/re_cache.h @@ -36,6 +36,7 @@ enum rspamd_re_type { RSPAMD_RE_RAWHEADER, RSPAMD_RE_ALLHEADER, RSPAMD_RE_MIME, + RSPAMD_RE_RAWMIME, RSPAMD_RE_URL, RSPAMD_RE_BODY, RSPAMD_RE_MAX |