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 07bd28e..53b9c5e 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
index 91b5f81..9274430 100644 (file)
@@ -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
index 8f1a181..82b9424 100644 (file)
@@ -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;