From 549a24c5216c92401cf6e17cb5a4a40622037f70 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 4 Oct 2000 20:10:27 +0000 Subject: IMAP4 (pre-rev1) doesn't support the 'LIST "" ""' idiom, so don't use it. * providers/imap/camel-imap-store.c (imap_connect): IMAP4 (pre-rev1) doesn't support the 'LIST "" ""' idiom, so don't use it. Just assume the dir_sep is '/'. Shrug. svn path=/trunk/; revision=5714 --- camel/providers/imap/camel-imap-store.c | 47 ++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index cb7df3d1cb..bcc8b6d504 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -274,27 +274,36 @@ imap_connect (CamelService *service, CamelException *ex) store->has_status_capability = FALSE; g_free (result); - /* We now need to find out which directory separator this daemon uses */ - response = camel_imap_command (store, NULL, ex, "LIST \"\" \"\""); - if (!response) - return FALSE; - result = camel_imap_response_extract (response, "LIST", ex); - if (!result) - return FALSE; - else { - char *flags, *sep, *folder; - - if (imap_parse_list_response (result, "", &flags, &sep, &folder)) { - if (*sep) { - g_free (store->dir_sep); - store->dir_sep = g_strdup (sep); + /* We now need to find out which directory separator this daemon + * uses. In the pre-4rev1 case, we can't do it, so we'll just + * hope that it's "/". + * FIXME: This code is wrong. The hierarchy separator is per + * namespace. + */ + if (store->server_level >= IMAP_LEVEL_IMAP4REV1) { + response = camel_imap_command (store, NULL, ex, + "LIST \"\" \"\""); + if (!response) + return FALSE; + result = camel_imap_response_extract (response, "LIST", ex); + if (!result) + return FALSE; + else { + char *flags, *sep, *folder; + + if (imap_parse_list_response (result, "", &flags, + &sep, &folder)) { + if (*sep) { + g_free (store->dir_sep); + store->dir_sep = g_strdup (sep); + } } + + g_free (flags); + g_free (sep); + g_free (folder); + g_free (result); } - - g_free (flags); - g_free (sep); - g_free (folder); - g_free (result); } camel_remote_store_refresh_folders (CAMEL_REMOTE_STORE (store), ex); -- cgit v1.2.3