[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.85, 1.86

cras at dovecot.org cras at dovecot.org
Wed Oct 20 23:46:40 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv9042/lib-storage/index/maildir

Modified Files:
	maildir-storage.c 
Log Message:
Removed special Maildir/.INBOX directory. Indexes are now stored in maildir
root.



Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- maildir-storage.c	21 Sep 2004 14:40:06 -0000	1.85
+++ maildir-storage.c	20 Oct 2004 20:46:37 -0000	1.86
@@ -208,8 +208,9 @@
 	if (storage->index_dir == NULL)
 		return NULL;
 
-	if (strcmp(name, "INBOX") == 0 && storage->inbox_path != NULL)
-		return storage->inbox_path;
+	if (strcmp(name, "INBOX") == 0 &&
+	    strcmp(storage->index_dir, storage->dir) == 0)
+		return storage->dir;
 
 	if (full_filesystem_access && (*name == '/' || *name == '~'))
 		return maildir_get_absolute_path(name, FALSE);
@@ -328,23 +329,13 @@
 
 static int verify_inbox(struct index_storage *storage)
 {
-	const char *inbox;
+	const char *path;
 
-	if (storage->inbox_path == NULL) {
-		/* first make sure the cur/ new/ and tmp/ dirs exist
-		   in root dir */
-		if (create_maildir(storage, storage->dir, TRUE) < 0)
-			return -1;
+	path = storage->inbox_path != NULL ?
+		storage->inbox_path : storage->dir;
 
-		/* create the .INBOX directory */
-		inbox = t_strconcat(storage->index_dir,
-				    "/"MAILDIR_FS_SEP_S"INBOX", NULL);
-		if (mkdir_verify(storage, inbox, TRUE) < 0)
-			return -1;
-	} else {
-		if (create_maildir(storage, storage->inbox_path, TRUE) < 0)
-			return -1;
-	}
+	if (create_maildir(storage, path, TRUE) < 0)
+		return -1;
 
 	/* make sure the index directories exist */
 	if (create_index_dir(storage, "INBOX") < 0)



More information about the dovecot-cvs mailing list