From d05a75a2b84c23d1f94233c14a632898663f28d1 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 22 Aug 2002 19:28:22 +0000 Subject: Workaround for Courier imap's brokeness when LSUBing the INBOX folder when 2002-08-22 Jeffrey Stedfast * 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 --- camel/providers/imap/camel-imap-utils.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'camel/providers/imap/camel-imap-utils.c') 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; } -- cgit v1.2.3