From 5071447bada785511249a2474beeeafecfd9c759 Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Thu, 8 Jan 2004 19:54:56 +0000 Subject: [PATCH] 0.9.8claws21 * src/procmime.c check for "MIME-Version: 1.0" in message/rfc882 MIME-parts, otherwise thread the message content as one text part and don't assume charset US-ASCII which is only specified as default for MIME-messages --- ChangeLog.claws | 8 ++++++++ configure.ac | 2 +- src/procmime.c | 28 ++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 07bd28e4c..53b9c5e41 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,11 @@ +2004-01-08 [christoph] 0.9.8claws21 + + * src/procmime.c + check for "MIME-Version: 1.0" in message/rfc882 MIME-parts, + otherwise thread the message content as one text part and + don't assume charset US-ASCII which is only specified as + default for MIME-messages + 2004-01-08 [paul] 0.9.8claws20 * src/plugins/clamav/clamav_plugin.c diff --git a/configure.ac b/configure.ac index 91b5f81a7..92744307f 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=8 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=20 +EXTRA_VERSION=21 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/procmime.c b/src/procmime.c index 8f1a18123..82b9424e3 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -962,6 +962,8 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo) NULL, TRUE}, {"Content-Disposition:", NULL, TRUE}, + {"MIME-Version:", + NULL, TRUE}, {NULL, NULL, FALSE}}; guint content_start, i; FILE *fp; @@ -977,12 +979,26 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo) content_start = ftell(fp); fclose(fp); - procmime_parse_mimepart(mimeinfo, - hentry[0].body, hentry[1].body, - hentry[2].body, hentry[3].body, - hentry[4].body, - mimeinfo->filename, content_start, - mimeinfo->length - (content_start - mimeinfo->offset)); + if ((hentry[5].body != NULL) && !strcmp(hentry[5].body, "1.0")) { + procmime_parse_mimepart(mimeinfo, + hentry[0].body, hentry[1].body, + hentry[2].body, hentry[3].body, + hentry[4].body, + mimeinfo->filename, content_start, + mimeinfo->length - (content_start - mimeinfo->offset)); + } else { + MimeInfo *subinfo; + + subinfo = procmime_mimeinfo_new(); + subinfo->encoding_type = ENC_BINARY; + subinfo->type = MIMETYPE_TEXT; + subinfo->subtype = g_strdup("plain"); + subinfo->filename = g_strdup(mimeinfo->filename); + subinfo->offset = content_start; + subinfo->length = mimeinfo->length - (content_start - mimeinfo->offset); + + g_node_append(mimeinfo->node, subinfo->node); + } for (i = 0; i < (sizeof hentry / sizeof hentry[0]); i++) { g_free(hentry[i].body); hentry[i].body = NULL; -- 2.25.1