Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8817:d8c071203322 HEAD
dbox: Changed the default mailbox dir name, subscriptions and uidvalidity filenames.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 12 Mar 2009 17:38:36 -0400 |
parents | 0e7e25da544c |
children | 1865ca29524f |
files | src/lib-storage/index/dbox/dbox-index.c src/lib-storage/index/dbox/dbox-storage.c src/lib-storage/index/dbox/dbox-storage.h |
diffstat | 3 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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); }
--- 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 @@ 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 @@ 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)
--- 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."