From aa1f58529889df10d729e01c02e3922e2dced77a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 27 Oct 2000 20:19:48 +0000 Subject: Work around Outlook brokenness in iMIP parsing by only quoting * camel-mime-utils.c (header_param_list_format_append): Work around Outlook brokenness in iMIP parsing by only quoting Content-type parameters when the quoting is mandatory. svn path=/trunk/; revision=6237 --- camel/ChangeLog | 6 ++++++ camel/camel-mime-utils.c | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 8cc5d03f3a..dc33a42898 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2000-10-27 Dan Winship + + * camel-mime-utils.c (header_param_list_format_append): Work + around Outlook brokenness in iMIP parsing by only quoting + Content-type parameters when the quoting is mandatory. + 2000-10-27 * providers/pop3/Makefile.am: Tidy up build diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index 22b6dfcff0..76aa672cae 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -2202,14 +2202,30 @@ static void header_param_list_format_append(GString *out, struct _header_param *p) { int len = out->len; + char *ch; + while (p) { int here = out->len; if (len+strlen(p->name)+strlen(p->value)>60) { out = g_string_append(out, "\n\t"); len = 0; } - /* FIXME: format the value properly */ - g_string_sprintfa(out, " ; %s=\"%s\"", p->name, p->value); + + g_string_sprintfa(out, " ; %s=", p->name); + + /* Outlook will not recognize an iTIP attachment with + * eg 'method="request"'. It must be 'method=request'. + * So only quote if we need to. (Sigh) + */ + for (ch = p->value; *ch; ch++) { + if (is_tspecial(*ch)) + break; + } + if (!*ch) + g_string_append(out, p->value); + else + quote_word(out, TRUE, p->value, strlen(p->value)); + len += (out->len - here); p = p->next; } -- cgit v1.2.3