aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-09-14 05:36:28 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-09-14 05:36:28 +0800
commite1aea06269544e81edbcc617dc00f672a7dc4deb (patch)
tree8ee667daa91004df1545659470d1f0dcf31d7919
parent584b87ddf1534d91a72e85e831d9559bbb4d26a2 (diff)
downloadgsoc2013-evolution-e1aea06269544e81edbcc617dc00f672a7dc4deb.tar.gz
gsoc2013-evolution-e1aea06269544e81edbcc617dc00f672a7dc4deb.tar.zst
gsoc2013-evolution-e1aea06269544e81edbcc617dc00f672a7dc4deb.zip
If header_msgid_decode fails for the content-id field, just grab whatever
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. svn path=/trunk/; revision=18070
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-mime-part.c17
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);