diff options
-rw-r--r-- | camel/ChangeLog | 7 | ||||
-rw-r--r-- | camel/camel-mime-part.c | 17 |
2 files changed, 22 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index b029bbcb0f..d421ac2c8c 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2002-09-13 Jeffrey Stedfast <fejj@ximian.com> + + * camel-mime-part.c (process_header): If header_msgid_decode fails + for the content-id field, just grab whatever is between the <>'s + (yes, this means that the content-id is invalid - but what can ya + do?). Addresses bug #21027. + 2002-09-11 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_encode_string): Revert a patch that I diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index 3ebd45e6aa..c7545a6a9c 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -212,7 +212,7 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_ { CamelMimePart *mime_part = CAMEL_MIME_PART (medium); CamelHeaderType header_type; - const char *charset; + const char *charset, *p; char *text; /* Try to parse the header pair. If it corresponds to something */ @@ -234,7 +234,20 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_ break; case HEADER_CONTENT_ID: g_free (mime_part->content_id); - mime_part->content_id = header_msgid_decode (header_value); + if (!(mime_part->content_id = header_msgid_decode (header_value))) { + header_decode_lwsp (&header_value); + if (*header_value == '<') { + p = header_value; + while (*p && *p != '>') + p++; + mime_part->content_id = g_strndup (header_value, p - header_value); + } else if (*header_value) { + mime_part->content_id = g_strdup (header_value); + } + + if (mime_part->header_value) + g_strstrip (mime_part->header_value); + } break; case HEADER_ENCODING: text = header_token_decode (header_value); |