aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-10-28 04:19:48 +0800
committerDan Winship <danw@src.gnome.org>2000-10-28 04:19:48 +0800
commitaa1f58529889df10d729e01c02e3922e2dced77a (patch)
tree770a6485b687315918aa3065fd1ef32f87e8e90f
parentffe49b7164bd1caf5f85db47505188842f44e75f (diff)
downloadgsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar.gz
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar.bz2
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar.lz
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar.xz
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.tar.zst
gsoc2013-evolution-aa1f58529889df10d729e01c02e3922e2dced77a.zip
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
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-mime-utils.c20
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 <danw@helixcode.com>
+
+ * 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 <jpr@helixcode.com>
* 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;
}