aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-05-22 00:36:27 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-05-22 00:36:27 +0800
commitf1261f2b5751408f783f8b9ab39cb13a72ff8aa5 (patch)
treee10adc4eae677a7d618aacbc8279238b8cb2274f /camel
parentcae54fd495fc3d51d514e131203de8ffc14c0574 (diff)
downloadgsoc2013-evolution-f1261f2b5751408f783f8b9ab39cb13a72ff8aa5.tar.gz
gsoc2013-evolution-f1261f2b5751408f783f8b9ab39cb13a72ff8aa5.tar.zst
gsoc2013-evolution-f1261f2b5751408f783f8b9ab39cb13a72ff8aa5.zip
Added a workaround for broken IMAP. Hopefully by forcing only the IMAP4
2004-05-21 Jeffrey Stedfast <fejj@novell.com> * providers/imap/camel-imap-store.c (connect_to_server): Added a workaround for broken IMAP. Hopefully by forcing only the IMAP4 command subst, we can work around their suckage. svn path=/trunk/; revision=26034
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/providers/imap/camel-imap-store.c33
2 files changed, 38 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index f2931383e2..5eabaa643b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-21 Jeffrey Stedfast <fejj@novell.com>
+
+ * providers/imap/camel-imap-store.c (connect_to_server): Added a
+ workaround for broken IMAP. Hopefully by forcing only the IMAP4
+ command subst, we can work around their suckage.
+
2004-05-21 Not Zed <NotZed@Ximian.com>
* camel-session.c (camel_session_get_password): added a 'domain'
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 9c70245227..75c609a6bf 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -525,6 +525,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE
CamelImapResponse *response;
CamelStream *tcp_stream;
CamelSockOptData sockopt;
+ gboolean force_imap4 = FALSE;
struct hostent *h;
int clean_quit;
int port, ret;
@@ -613,8 +614,33 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE
if (!strncmp(buf, "* PREAUTH", 9))
store->preauthed = TRUE;
- if (strstr (buf, "Courier-IMAP"))
+ if (strstr (buf, "Courier-IMAP")) {
+ /* Courier-IMAP is braindamaged. So far this flag only
+ * works around the fact that Courier-IMAP is known to
+ * give invalid BODY responses seemingly because its
+ * MIME parser sucks. In any event, we can't rely on
+ * them so we always have to request the full messages
+ * rather than getting individual parts. */
store->braindamaged = TRUE;
+ } else if (strstr (buf, "WEB.DE") || strstr (buf, "Mail2World")) {
+ /* This is a workaround for servers which advertise
+ * IMAP4rev1 but which can sometimes subtly break in
+ * various ways if we try to use IMAP4rev1 queries.
+ *
+ * WEB.DE: when querying for HEADER.FIELDS.NOT, it
+ * returns an empty literal for the headers. Many
+ * complaints about empty message-list fields on the
+ * mailing lists and probably a few bugzilla bugs as
+ * well.
+ *
+ * Mail2World (aka NamePlanet): When requesting
+ * message info's, it ignores the fact that we
+ * requested BODY.PEEK[HEADER.FIELDS.NOT (RECEIVED)]
+ * and so the responses are incomplete. See bug #58766
+ * for details.
+ **/
+ force_imap4 = TRUE;
+ }
g_free (buf);
@@ -634,6 +660,11 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE
return FALSE;
}
+ if (force_imap4) {
+ store->capabilities &= ~IMAP_CAPABILITY_IMAP4REV1;
+ store->server_level = IMAP_LEVEL_IMAP4;
+ }
+
#ifdef HAVE_SSL
if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
if (store->capabilities & IMAP_CAPABILITY_STARTTLS)