diff options
Diffstat (limited to 'src/libserver/re_cache.c')
-rw-r--r-- | src/libserver/re_cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index cb454d16d..a09d04e14 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -1178,6 +1178,12 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, break; case RSPAMD_RE_MIMEHEADER: PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, parts), i, mime_part) { + if (mime_part->parent_part == NULL || + !IS_PART_MULTIPART(mime_part->parent_part) || + IS_PART_MESSAGE(mime_part)) { + /* We filter parts that have no multipart parent or are a messages here */ + continue; + } rh = rspamd_message_get_header_from_hash(mime_part->raw_headers, re_class->type_data, FALSE); |