dovecot-1.1: dbox: Support creating non-selectable mailboxes ("d...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 2 16:19:59 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/326ca0ed8983
changeset: 7585:326ca0ed8983
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 02 16:19:54 2008 +0300
description:
dbox: Support creating non-selectable mailboxes ("directories").

diffstat:

1 file changed, 3 insertions(+), 2 deletions(-)
src/lib-storage/index/dbox/dbox-storage.c |    5 +++--

diffs (28 lines):

diff -r e528d9e3cdc8 -r 326ca0ed8983 src/lib-storage/index/dbox/dbox-storage.c
--- 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_storage_mailbox_close(st
 }
 
 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 ma
 	   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");


More information about the dovecot-cvs mailing list