aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-10-05 04:10:27 +0800
committerDan Winship <danw@src.gnome.org>2000-10-05 04:10:27 +0800
commit549a24c5216c92401cf6e17cb5a4a40622037f70 (patch)
tree45c5a2ad942fd36448d607a43db3702817ceaa10 /camel/providers/imap
parenta426f7996f5617f86297f5641a8dfb2ca675963a (diff)
downloadgsoc2013-evolution-549a24c5216c92401cf6e17cb5a4a40622037f70.tar.gz
gsoc2013-evolution-549a24c5216c92401cf6e17cb5a4a40622037f70.tar.zst
gsoc2013-evolution-549a24c5216c92401cf6e17cb5a4a40622037f70.zip
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
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c47
1 files changed, 28 insertions, 19 deletions
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);