summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2022-05-10 14:05:13 +0200
committerMilan Crha <mcrha@redhat.com>2022-05-10 14:05:13 +0200
commit3a6f513663534154d53223f00561f37386264041 (patch)
tree79c03dc11cafe44fdb86bf51bf1e8bc7bd4c466c
parentc7142d1d61c5a5bd924c2788701de2765f38916f (diff)
downloadevolution-data-server-3a6f513663534154d53223f00561f37386264041.tar.gz
I#389 - IMAPx: Fails to create folder with NIL folder hierarchy delimiter
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/389
-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,