{
const char *error;
+ if (path == NULL &&
+ !mailbox_list_get_root_path(list, type, &path))
+ return 0;
+
if (mailbox_list_try_mkdir_root(list, path, type, &error) < 0) {
mailbox_list_set_critical(list, "%s", error);
return -1;
void mailbox_list_get_root_permissions(struct mailbox_list *list,
struct mailbox_permissions *permissions_r);
/* mkdir() a root directory of given type with proper permissions. The path can
- be either the root itself or point to a directory under the root. */
+ be either the root itself or point to a directory under the root. If path is
+ NULL, the root path of the given type is looked up automatically; if there is
+ no such path, nothing is done. */
int mailbox_list_mkdir_root(struct mailbox_list *list, const char *path,
enum mailbox_list_path_type type);
/* Like mailbox_list_mkdir_root(), but don't log an error if it fails. */