imap_folder->summary = NULL;
/* SELECT the IMAP mail spool */
- if (url && url->path && strcmp (folder->full_name, "INBOX"))
+ if (url && url->path && *(url->path + 1) && strcmp (folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s/%s", url->path + 1, folder->full_name);
else
folder_path = g_strdup (folder->full_name);
if (imap_folder->count != -1)
return imap_folder->count;
- if (url && url->path && strcmp (folder->full_name, "INBOX"))
+ if (url && url->path && *(url->path + 1) && strcmp (folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s/%s", url->path + 1, folder->full_name);
else
folder_path = g_strdup (folder->full_name);
}
mem->buffer = g_byte_array_append (mem->buffer, g_strdup("\r\n"), 3);
- if (url && url->path && strcmp(folder->full_name, "INBOX"))
+
+ if (url && url->path && *(url->path + 1) && strcmp(folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s/%s", url->path, folder->full_name);
else
folder_path = g_strdup (folder->full_name);
+
status = camel_imap_command (CAMEL_IMAP_STORE (folder->parent_store),
folder, &result,
"APPEND %s (\\Seen) {%d}\r\n%s",
}
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder,
- &result, "LIST \"\" \"%s/*\"", folder_path);
+ &result, "LIST \"\" \"%s%s\"", folder_path,
+ *folder_path ? "/*" : "*");
if (status != CAMEL_IMAP_OK) {
CamelService *service = CAMEL_SERVICE (folder->parent_store);
g_free (flags);
/* chop out the folder prefix */
- if (!strncmp (folder, folder_path, strlen (folder_path))) {
+ if (*folder_path && !strncmp (folder, folder_path, strlen (folder_path))) {
f = folder + strlen (folder_path) + 1;
memmove (folder, f, strlen (f) + 1);
}
gchar *result, *folder_path;
gint status;
- if (url && url->path && strcmp (folder->full_name, "INBOX"))
+ if (url && url->path && *(url->path + 1) && strcmp (folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s/%s", url->path + 1, folder->full_name);
else
folder_path = g_strdup (folder->full_name);
return TRUE;
/* create the directory for the subfolder */
- if (url && url->path && strcmp (folder->full_name, "INBOX"))
+ if (url && url->path && *(url->path + 1) && strcmp (folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s/%s", url->path + 1, folder->full_name);
else
folder_path = g_strdup (folder->full_name);