0.9.8claws21
authorChristoph Hohmann <reboot@gmx.ch>
Thu, 8 Jan 2004 19:54:56 +0000 (19:54 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Thu, 8 Jan 2004 19:54:56 +0000 (19:54 +0000)
* 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
configure.ac
src/procmime.c

index 07bd28e4c7c35899187b501ba21fade82827da91..53b9c5e417b2ea0e85d94f5fd8d20ee107439feb 100644 (file)
@@ -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
 2004-01-08 [paul]      0.9.8claws20
 
        * src/plugins/clamav/clamav_plugin.c
index 91b5f81a7f8f3936318548cccad2bfaf596d6b5a..92744307f40cf4a6f232c66d49dd58e8cec9257c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 8f1a181237bc8e413431ce608d68d664fb9573b5..82b9424e3446e735b1393a1bdd5d3c98c72310a1 100644 (file)
@@ -962,6 +962,8 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
                                                   NULL, TRUE},
                                {"Content-Disposition:",
                                                   NULL, TRUE},
                                                   NULL, TRUE},
                                {"Content-Disposition:",
                                                   NULL, TRUE},
+                               {"MIME-Version:",
+                                                  NULL, TRUE},
                                {NULL,             NULL, FALSE}};
        guint content_start, i;
        FILE *fp;
                                {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);
 
        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;
        for (i = 0; i < (sizeof hentry / sizeof hentry[0]); i++) {
                g_free(hentry[i].body);
                hentry[i].body = NULL;