diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index d241ee5..d22dc54 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1371,9 +1371,11 @@ imap_connect (CamelService *service, GError **error)
 	    && camel_store_summary_count((CamelStoreSummary *)store->summary) == 0) {
 		CamelStoreInfo *si;
 
-		/* look in all namespaces */
-		if (!get_folders_sync (store, NULL, &local_error))
-			goto done;
+		if (!(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
+			/* look in all namespaces */
+			if (!get_folders_sync (store, NULL, &local_error))
+				goto done;
+		}
 
 		/* Make sure INBOX is present/subscribed */
 		si = camel_store_summary_path((CamelStoreSummary *)store->summary, "INBOX");
@@ -2640,8 +2642,11 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg)
 		get_folders_sync (store, "*", NULL);
 	}
 
-	/* look in all namespaces */
-	get_folders_sync (store, NULL, &m->error);
+	if (!(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
+		/* look in all namespaces */
+		get_folders_sync (store, NULL, &m->error);
+	}
+
 	camel_store_summary_save ((CamelStoreSummary *)store->summary);
 done:
 	camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
