aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-utils.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-23 03:28:22 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-23 03:28:22 +0800
commitd05a75a2b84c23d1f94233c14a632898663f28d1 (patch)
tree54d330f41658a5b0dcf6fca734c3059876732f22 /camel/providers/imap/camel-imap-utils.c
parent34208006ae99718571b35055cec8d8e2718df1dc (diff)
downloadgsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar.gz
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar.bz2
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar.lz
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar.xz
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.tar.zst
gsoc2013-evolution-d05a75a2b84c23d1f94233c14a632898663f28d1.zip
Workaround for Courier imap's brokeness when LSUBing the INBOX folder when
2002-08-22 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_parse_list_response): Workaround for Courier imap's brokeness when LSUBing the INBOX folder when it isn't subscribed to. Fixes bug #28929. svn path=/trunk/; revision=17841
Diffstat (limited to 'camel/providers/imap/camel-imap-utils.c')
-rw-r--r--camel/providers/imap/camel-imap-utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index 4370d890ba..e07d1ccac3 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -292,6 +292,7 @@ imap_parse_namespace_response (const char *response)
gboolean
imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, char *sep, char **folder)
{
+ gboolean is_lsub = FALSE;
const char *word;
size_t len;
@@ -302,6 +303,10 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
if (g_strncasecmp (word, "LIST", 4) && g_strncasecmp (word, "LSUB", 4))
return FALSE;
+ /* check if we are looking at an LSUB response */
+ if (word[1] == 'S' || word[1] == 's')
+ is_lsub = TRUE;
+
/* get the flags */
word = imap_next_word (word);
if (*word != '(')
@@ -363,6 +368,21 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
if (!mailbox)
return FALSE;
+ /* Kludge around Courier imap's LSUB response for INBOX when it
+ * isn't subscribed to.
+ *
+ * Ignore any \Noselect flags for INBOX when parsing
+ * an LSUB response to work around the following response:
+ *
+ * * LSUB (\Noselect \HasChildren) "." "INBOX"
+ *
+ * Fixes bug #28929 (albeight in a very dodgy way imho, but what
+ * can ya do when ya got the ignorance of marketing breathing
+ * down your neck?)
+ */
+ if (is_lsub && !strcasecmp (mailbox, "INBOX"))
+ *flags &= ~CAMEL_FOLDER_NOSELECT;
+
*folder = mailbox;
}