From: Timo Sirainen Date: Wed, 6 Aug 2003 14:39:04 +0000 (+0300) Subject: Some message/rfc822 mails were returned as text/plain X-Git-Tag: 1.1.alpha1~4441 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6abe6b206a164fb362f9d7314cf14fb3f42d3509;p=thirdparty%2Fdovecot%2Fcore.git Some message/rfc822 mails were returned as text/plain --HG-- branch : HEAD --- diff --git a/src/lib-imap/imap-bodystructure.c b/src/lib-imap/imap-bodystructure.c index 3aa2fbadd1..f3b34e12f6 100644 --- a/src/lib-imap/imap-bodystructure.c +++ b/src/lib-imap/imap-bodystructure.c @@ -380,18 +380,23 @@ static void part_write_body(struct message_part *part, data = t_new(struct message_part_body_data, 1); } - /* "content type" "subtype" */ - str_append(str, NVL(data->content_type, "\"text\"")); - str_append_c(str, ' '); - if (data->content_subtype != NULL) - str_append(str, data->content_subtype); + if (part->flags & MESSAGE_PART_FLAG_MESSAGE_RFC822) + str_append(str, "\"message\" \"rfc822\""); else { - if (data->content_type == NULL || - strcasecmp(data->content_type, "\"text\"") == 0) - str_append(str, "\"plain\""); - else - str_append(str, "\"unknown\""); + /* "content type" "subtype" */ + str_append(str, NVL(data->content_type, "\"text\"")); + str_append_c(str, ' '); + + if (data->content_subtype != NULL) + str_append(str, data->content_subtype); + else { + if (data->content_type == NULL || + strcasecmp(data->content_type, "\"text\"") == 0) + str_append(str, "\"plain\""); + else + str_append(str, "\"unknown\""); + } } /* ("content type param key" "value" ...) */