]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: Support creating non-selectable mailboxes ("directories").
authorTimo Sirainen <tss@iki.fi>
Mon, 2 Jun 2008 13:19:54 +0000 (16:19 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 2 Jun 2008 13:19:54 +0000 (16:19 +0300)
--HG--
branch : HEAD

src/lib-storage/index/dbox/dbox-storage.c

index 957fc73ec3ec2d3e0e8fee9795d3086afedf0751..eea5663f7b69c7476e5c3bbdbd515974c42db9df 100644 (file)
@@ -322,13 +322,14 @@ static int dbox_storage_mailbox_close(struct mailbox *box)
 }
 
 static int dbox_mailbox_create(struct mail_storage *_storage,
-                              const char *name, bool directory ATTR_UNUSED)
+                              const char *name, bool directory)
 {
        struct dbox_storage *storage = (struct dbox_storage *)_storage;
        const char *path, *alt_path;
        struct stat st;
 
        path = mailbox_list_get_path(_storage->list, name,
+                                    directory ? MAILBOX_LIST_PATH_TYPE_DIR :
                                     MAILBOX_LIST_PATH_TYPE_MAILBOX);
        if (stat(path, &st) == 0) {
                mail_storage_set_error(_storage, MAIL_ERROR_NOTPOSSIBLE,
@@ -340,7 +341,7 @@ static int dbox_mailbox_create(struct mail_storage *_storage,
           race conditions with RENAME/DELETE), but if something crashed and
           left it lying around we don't want to start overwriting files in
           it. */
-       alt_path = dbox_get_alt_path(storage, path);
+       alt_path = directory ? NULL : dbox_get_alt_path(storage, path);
        if (alt_path != NULL && stat(alt_path, &st) == 0) {
                mail_storage_set_error(_storage, MAIL_ERROR_NOTPOSSIBLE,
                                       "Mailbox already exists");