diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-22 22:35:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-22 22:35:13 +0100 |
commit | 189acef32f8c581a2c65bcb04306c3ea8585be9e (patch) | |
tree | c5c6a0c30bd2abb55a017a34f9a25fcd9a9fc42a /src/libserver/re_cache.c | |
parent | 1f8e4827f0c4ea5b91736d6c1926318151343461 (diff) | |
download | rspamd-189acef32f8c581a2c65bcb04306c3ea8585be9e.tar.gz rspamd-189acef32f8c581a2c65bcb04306c3ea8585be9e.zip |
[Minor] Exclude irrelevant parts from mime_headers regexp
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); |