]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix a455c6542212948969b6c115344e9d059606407a missing part
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Feb 2020 17:19:47 +0000 (17:19 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Feb 2020 17:19:47 +0000 (17:19 +0000)
src/libmime/message.h
src/libmime/mime_encoding.c
src/lua/lua_mimepart.c

index c11b273ebcd04fdd91a5832906fec589840d9b54..eeba0a0533e4f4fe2e166dca9be2d565e31d791e 100644 (file)
@@ -114,7 +114,7 @@ struct rspamd_mime_part {
 #define RSPAMD_MIME_TEXT_PART_FLAG_BALANCED (1 << 1)
 #define RSPAMD_MIME_TEXT_PART_FLAG_EMPTY (1 << 2)
 #define RSPAMD_MIME_TEXT_PART_FLAG_HTML (1 << 3)
-#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT (1 << 4)
+#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_RAW (1 << 4)
 #define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_ENCODED (1 << 5)
 #define RSPAMD_MIME_TEXT_PART_HAS_SUBNORMAL (1 << 6)
 #define RSPAMD_MIME_TEXT_PART_NORMALISED (1 << 7)
index a91447ab6967d3b21c25e3ef8df65c03fb52fe38..47295d95bf83793dbc9386c2200c005c8fa28582 100644 (file)
@@ -659,6 +659,10 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
        rspamd_ftok_t charset_tok;
        struct rspamd_mime_part *part = text_part->mime_part;
 
+       if (rspamd_str_has_8bit (text_part->raw.begin, text_part->raw.len)) {
+               text_part->flags |= RSPAMD_MIME_TEXT_PART_FLAG_8BIT_RAW;
+       }
+
        /* Allocate copy storage */
        part_content = g_byte_array_sized_new (text_part->parsed.len);
        memcpy (part_content->data, text_part->parsed.begin, text_part->parsed.len);
index c221cbfa3417c532b2100dc31d47d1b101559983..7ce6d251d2f7b564b2e14a897989392ed3d3d14f 100644 (file)
@@ -625,7 +625,7 @@ lua_textpart_has_8bit_raw (lua_State * L)
        struct rspamd_mime_text_part *part = lua_check_textpart (L);
 
        if (part) {
-               if (part->flags & RSPAMD_MIME_TEXT_PART_FLAG_8BIT) {
+               if (part->flags & RSPAMD_MIME_TEXT_PART_FLAG_8BIT_RAW) {
                        lua_pushboolean (L, TRUE);
                }
                else {