summaryrefslogtreecommitdiff
path: root/src/camel/providers/imapx/camel-imapx-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/camel/providers/imapx/camel-imapx-store.c')
-rw-r--r--src/camel/providers/imapx/camel-imapx-store.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/camel/providers/imapx/camel-imapx-store.c b/src/camel/providers/imapx/camel-imapx-store.c
index 140f35745..c5d1f819f 100644
--- a/src/camel/providers/imapx/camel-imapx-store.c
+++ b/src/camel/providers/imapx/camel-imapx-store.c
@@ -2317,6 +2317,16 @@ imapx_store_create_folder_sync (CamelStore *store,
goto exit;
separator = camel_imapx_mailbox_get_separator (parent_mailbox);
+
+ /* NIL separator means flat structure, where subfolders cannot be created */
+ if (!separator) {
+ g_object_unref (parent_mailbox);
+ /* Cannot set error here, like in the development version, due to untranslated
+ string, thus let it create the folder in the top level. Evolution throws
+ an error about "folder not found" due to using the path with the parent folder. */
+ goto check_namespace;
+ }
+
parent_mailbox_name = camel_imapx_mailbox_get_name (parent_mailbox);
mailbox_name = g_strdup_printf (
@@ -2355,7 +2365,7 @@ check_namespace:
check_separator:
- if (strchr (folder_name, separator) != NULL) {
+ if (separator && strchr (folder_name, separator) != NULL) {
g_set_error (
error, CAMEL_FOLDER_ERROR,
CAMEL_FOLDER_ERROR_INVALID_PATH,