aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r--camel/providers/imap/camel-imap-folder.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 1b0de9ca5f..74148d3d92 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -208,21 +208,26 @@ imap_init (CamelFolder *folder, CamelStore *parent_store, CamelFolder *parent_fo
/* now lets find out if we can do searches... */
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder,
&result, "CAPABILITY");
+
+ /* ugh, I forgot that CAPABILITY doesn't have a response code */
if (status != CAMEL_IMAP_OK) {
CamelService *service = CAMEL_SERVICE (folder->parent_store);
+
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get capabilities on IMAP server %s: %s.",
service->url->host,
status == CAMEL_IMAP_ERR ? result :
"Unknown error");
}
-
- if (strstr (result, "SEARCH"))
+
+ if (strstrcase (result, "SEARCH"))
folder->has_search_capability = TRUE;
else
folder->has_search_capability = FALSE;
g_free (result);
+
+ fprintf (stderr, "IMAP provider does%shave SEARCH support\n", folder->has_search_capability ? " " : "n't ");
/* some IMAP daemons support user-flags *
* I would not, however, rely on this feature as *
@@ -242,6 +247,7 @@ imap_init (CamelFolder *folder, CamelStore *parent_store, CamelFolder *parent_fo
&result, "SELECT %s", folder->full_name);
if (status != CAMEL_IMAP_OK) {
CamelService *service = CAMEL_SERVICE (folder->parent_store);
+
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not SELECT %s on IMAP server %s: %s.",
folder->full_name, service->url->host,