Mercurial > dovecot > core-2.2
changeset 7585:326ca0ed8983 HEAD
dbox: Support creating non-selectable mailboxes ("directories").
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 02 Jun 2008 16:19:54 +0300 |
parents | e528d9e3cdc8 |
children | 40a660972c70 |
files | src/lib-storage/index/dbox/dbox-storage.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c Sat May 31 14:27:27 2008 +0300 +++ b/src/lib-storage/index/dbox/dbox-storage.c Mon Jun 02 16:19:54 2008 +0300 @@ -322,13 +322,14 @@ } 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 @@ 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");