dovecot-1.2: Message-decoder: Fixes to handling binary body parts.

dovecot at dovecot.org dovecot at dovecot.org
Tue May 26 02:45:06 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/7cb4741f076e
changeset: 9077:7cb4741f076e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 25 19:44:56 2009 -0400
description:
Message-decoder: Fixes to handling binary body parts.

diffstat:

1 file changed, 12 insertions(+), 14 deletions(-)
src/lib-mail/message-decoder.c |   26 ++++++++++++--------------

diffs (41 lines):

diff -r 73b468723964 -r 7cb4741f076e src/lib-mail/message-decoder.c
--- a/src/lib-mail/message-decoder.c	Mon May 25 19:30:27 2009 -0400
+++ b/src/lib-mail/message-decoder.c	Mon May 25 19:44:56 2009 -0400
@@ -219,25 +219,23 @@ message_decode_body_init_charset(struct 
 {
 	enum charset_flags flags;
 
-	if (ctx->charset_utf8)
-		return;
-
-	if (ctx->charset_trans != NULL &&
-	    strcasecmp(ctx->content_charset, ctx->charset_trans_charset) == 0) {
-		/* already have the correct translation selected */
-		return;
-	}
-
-	if (ctx->charset_trans != NULL)
-		charset_to_utf8_end(&ctx->charset_trans);
-	i_free_and_null(ctx->charset_trans_charset);
-
 	ctx->binary_input = ctx->content_charset == NULL &&
 		(ctx->flags & MESSAGE_DECODER_FLAG_RETURN_BINARY) != 0 &&
 		(part->flags & (MESSAGE_PART_FLAG_TEXT |
 				MESSAGE_PART_FLAG_MESSAGE_RFC822)) == 0;
-	if (ctx->binary_input)
+
+	if (ctx->charset_utf8 || ctx->binary_input)
 		return;
+
+	if (ctx->charset_trans != NULL && ctx->content_charset != NULL &&
+	    strcasecmp(ctx->content_charset, ctx->charset_trans_charset) == 0) {
+		/* already have the correct translation selected */
+		return;
+	}
+
+	if (ctx->charset_trans != NULL)
+		charset_to_utf8_end(&ctx->charset_trans);
+	i_free_and_null(ctx->charset_trans_charset);
 
 	flags = (ctx->flags & MESSAGE_DECODER_FLAG_DTCASE) != 0 ?
 		CHARSET_FLAG_DECOMP_TITLECASE : 0;


More information about the dovecot-cvs mailing list