]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: Remove MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 25 Apr 2018 11:19:27 +0000 (14:19 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 30 Aug 2018 08:18:58 +0000 (11:18 +0300)
As mentioned in previous commit, 0x80 isn't valid UTF-8 and we shouldn't
encourage using it. This implementation also can't be easily changed to
use unicode replacement character without larger changes to istream-nonuls.

Reverts 95fba2c295bb84639dc64ca5c9f2ccb9edc00ba7.

src/lib-mail/message-header-parser.c
src/lib-mail/message-header-parser.h

index 654a9f8f8a7d14f293db84f9296762d309986d89..e6ea377458a37bb72f863bcf87dd15c593d930eb 100644 (file)
@@ -3,7 +3,6 @@
 #include "lib.h"
 #include "buffer.h"
 #include "istream.h"
-#include "istream-nonuls.h"
 #include "str.h"
 #include "message-size.h"
 #include "message-header-parser.h"
@@ -29,16 +28,12 @@ message_parse_header_init(struct istream *input, struct message_size *hdr_size,
        struct message_header_parser_ctx *ctx;
 
        ctx = i_new(struct message_header_parser_ctx, 1);
-       if ((flags & MESSAGE_HEADER_REPLACE_NULS_WITH_0x80) != 0)
-               ctx->input = i_stream_create_nonuls(input, 0x80);
-       else {
-               ctx->input = input;
-               i_stream_ref(input);
-       }
+       ctx->input = input;
        ctx->hdr_size = hdr_size;
        ctx->name = str_new(default_pool, 128);
        ctx->flags = flags;
        ctx->value_buf = buffer_create_dynamic(default_pool, 4096);
+       i_stream_ref(input);
 
        if (hdr_size != NULL)
                i_zero(hdr_size);
index 38594bd18cb7d1720bd6851394d346e1165accf3..d6863524aabf2279adc8026612754ef30d8808b0 100644 (file)
@@ -13,9 +13,7 @@ enum message_header_parser_flags {
        /* Don't add CRs to full_value even if input had them */
        MESSAGE_HEADER_PARSER_FLAG_DROP_CR              = 0x02,
        /* Convert [CR+]LF+LWSP to a space character in full_value */
-       MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE        = 0x04,
-       /* Replace 0x0 symbols with 0x80 */
-       MESSAGE_HEADER_REPLACE_NULS_WITH_0x80           = 0x08,
+       MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE        = 0x04
 };
 
 struct message_header_line {