diff options
Diffstat (limited to 'src/plugins/regexp.c')
-rw-r--r-- | src/plugins/regexp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index c70b5d232..8a33402f2 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -613,6 +613,8 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task, const gchar .re = re, .found = FALSE }; + guint8 *ct; + gsize clen; gint r; @@ -710,8 +712,15 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task, const gchar else { regexp = re->regexp; } - - if (g_regex_match_full (regexp, part->orig->data, part->orig->len, 0, 0, NULL, &err) == TRUE) { + if (re->is_raw) { + ct = part->orig->data; + clen = part->orig->len; + } + else { + ct = part->content->data; + clen = part->content->len; + } + if (g_regex_match_full (regexp, ct, clen, 0, 0, NULL, &err) == TRUE) { if (G_UNLIKELY (re->is_test)) { msg_info ("process test regexp %s for mime part returned TRUE", re->regexp_text); } |