From 5c398e9109ab8bc02d9439d865ba61d8a2adb127 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 24 Jul 2018 15:00:19 +0300 Subject: [PATCH] lib-imap: Remove content_subtype==NULL checks This can never happen after the previous commit. This also changes the BODYSTRUCTURE output for invalid Content-Types, but since they're invalid anyway it doesn't really matter what the output is. --- src/lib-imap/imap-bodystructure.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/lib-imap/imap-bodystructure.c b/src/lib-imap/imap-bodystructure.c index 7a02292705..4357f8791a 100644 --- a/src/lib-imap/imap-bodystructure.c +++ b/src/lib-imap/imap-bodystructure.c @@ -128,10 +128,7 @@ static void part_write_body_multipart(const struct message_part *part, } str_append_c(str, ' '); - if (data->content_subtype != NULL) - imap_append_string(str, data->content_subtype); - else - str_append(str, "\"x-unknown\""); + imap_append_string(str, data->content_subtype); if (!extended) return; @@ -160,20 +157,12 @@ static void part_write_body(const struct message_part *part, /* "content type" "subtype" */ if (data->content_type == NULL) { text = TRUE; - str_append(str, "\"text\""); + str_append(str, "\"text\" \"plain\""); } else { text = (strcasecmp(data->content_type, "text") == 0); imap_append_string(str, data->content_type); - } - str_append_c(str, ' '); - - if (data->content_subtype != NULL) + str_append_c(str, ' '); imap_append_string(str, data->content_subtype); - else { - if (text) - str_append(str, "\"plain\""); - else - str_append(str, "\"unknown\""); } } -- 2.47.3