dovecot-1.2: dbox: Changed the default mailbox dir name, subscri...

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 12 23:43:43 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/d8c071203322
changeset: 8817:d8c071203322
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 12 17:38:36 2009 -0400
description:
dbox: Changed the default mailbox dir name, subscriptions and uidvalidity filenames.

diffstat:

3 files changed, 20 insertions(+), 6 deletions(-)
src/lib-storage/index/dbox/dbox-index.c   |    5 ++++-
src/lib-storage/index/dbox/dbox-storage.c |   14 +++++++++++---
src/lib-storage/index/dbox/dbox-storage.h |    7 +++++--

diffs (75 lines):

diff -r 0e7e25da544c -r d8c071203322 src/lib-storage/index/dbox/dbox-index.c
--- a/src/lib-storage/index/dbox/dbox-index.c	Thu Mar 12 17:30:45 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-index.c	Thu Mar 12 17:38:36 2009 -0400
@@ -160,11 +160,14 @@ dbox_index_set_corrupted(struct dbox_ind
 
 static uint32_t dbox_get_uidvalidity_next(struct mail_storage *storage)
 {
+	const char *fname;
 	const char *path;
 
+	fname = *storage->list->set.mailbox_dir_name == '\0' ?
+		DBOX_OLD_UIDVALIDITY_FILE_NAME : DBOX_UIDVALIDITY_FILE_NAME;
 	path = mailbox_list_get_path(storage->list, NULL,
 				     MAILBOX_LIST_PATH_TYPE_CONTROL);
-	path = t_strconcat(path, "/"DBOX_UIDVALIDITY_FILE_NAME, NULL);
+	path = t_strconcat(path, "/", fname, NULL);
 	return mailbox_uidvalidity_next(path);
 }
 
diff -r 0e7e25da544c -r d8c071203322 src/lib-storage/index/dbox/dbox-storage.c
--- a/src/lib-storage/index/dbox/dbox-storage.c	Thu Mar 12 17:30:45 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Thu Mar 12 17:38:36 2009 -0400
@@ -50,13 +50,15 @@ dbox_get_list_settings(struct mailbox_li
 		       const char **layout_r, const char **alt_dir_r,
 		       const char **error_r)
 {
+	const char *subs_fname = DBOX_SUBSCRIPTION_FILE_NAME;
 	bool debug = (storage->flags & MAIL_STORAGE_FLAG_DEBUG) != 0;
 
 	*layout_r = "fs";
 
 	memset(list_set, 0, sizeof(*list_set));
-	list_set->subscription_fname = DBOX_SUBSCRIPTION_FILE_NAME;
+	list_set->subscription_fname = subs_fname;
 	list_set->maildir_name = DBOX_MAILDIR_NAME;
+	list_set->mailbox_dir_name = DBOX_MAILBOX_DIR_NAME;
 
 	if (data == NULL || *data == '\0' || *data == ':') {
 		/* we won't do any guessing for this format. */
@@ -68,8 +70,14 @@ dbox_get_list_settings(struct mailbox_li
 
 	if (debug)
 		i_info("dbox: data=%s", data);
-	return mailbox_list_settings_parse(data, list_set, storage->ns,
-					   layout_r, alt_dir_r, error_r);
+	if (mailbox_list_settings_parse(data, list_set, storage->ns,
+					layout_r, alt_dir_r, error_r) < 0)
+		return -1;
+
+	if (*list_set->mailbox_dir_name == '\0' &&
+	    list_set->subscription_fname == subs_fname)
+		list_set->subscription_fname = DBOX_OLD_SUBSCRIPTION_FILE_NAME;
+	return 0;
 }
 
 static struct mail_storage *dbox_alloc(void)
diff -r 0e7e25da544c -r d8c071203322 src/lib-storage/index/dbox/dbox-storage.h
--- a/src/lib-storage/index/dbox/dbox-storage.h	Thu Mar 12 17:30:45 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-storage.h	Thu Mar 12 17:38:36 2009 -0400
@@ -5,10 +5,13 @@
 #include "mailbox-list-private.h"
 
 #define DBOX_STORAGE_NAME "dbox"
-#define DBOX_SUBSCRIPTION_FILE_NAME ".dbox-subscriptions"
-#define DBOX_UIDVALIDITY_FILE_NAME ".dbox-uidvalidity"
+#define DBOX_OLD_SUBSCRIPTION_FILE_NAME ".dbox-subscriptions"
+#define DBOX_OLD_UIDVALIDITY_FILE_NAME ".dbox-uidvalidity"
+#define DBOX_SUBSCRIPTION_FILE_NAME "subscriptions"
+#define DBOX_UIDVALIDITY_FILE_NAME "dovecot-uidvalidity"
 #define DBOX_INDEX_PREFIX "dovecot.index"
 
+#define DBOX_MAILBOX_DIR_NAME "mailboxes"
 #define DBOX_MAILDIR_NAME "dbox-Mails"
 #define DBOX_INDEX_NAME "dbox.index"
 #define DBOX_MAIL_FILE_MULTI_PREFIX "m."


More information about the dovecot-cvs mailing list