dovecot-2.2: lib-storage: Create a default namespace for auto-cr...

dovecot at dovecot.org dovecot at dovecot.org
Sun Mar 31 16:46:54 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/f617e2fcce66
changeset: 16127:f617e2fcce66
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Mar 31 16:46:11 2013 +0300
description:
lib-storage: Create a default namespace for auto-created shared mail_users.
Some code nowadays requires user to have prefix="" namespace.

diffstat:

 src/lib-storage/index/shared/shared-storage.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 426701831d00 -r f617e2fcce66 src/lib-storage/index/shared/shared-storage.c
--- a/src/lib-storage/index/shared/shared-storage.c	Thu Mar 28 11:37:07 2013 +0200
+++ b/src/lib-storage/index/shared/shared-storage.c	Sun Mar 31 16:46:11 2013 +0300
@@ -318,11 +318,19 @@
 		p_strdup(user->pool, storage->unexpanded_location);
 	new_ns->unexpanded_set = unexpanded_ns_set;
 
+	/* We need to create a prefix="" namespace for the owner */
+	if (mail_namespaces_init_location(owner, str_c(location), &error) < 0) {
+		mail_namespace_destroy(new_ns);
+		mail_user_unref(&owner);
+		return -1;
+	}
+
 	if (mail_storage_create(new_ns, NULL, _storage->flags |
 				MAIL_STORAGE_FLAG_NO_AUTOVERIFY, &error) < 0) {
 		mailbox_list_set_critical(list, "Namespace '%s': %s",
 					  new_ns->prefix, error);
 		mail_namespace_destroy(new_ns);
+		mail_user_unref(&owner);
 		return -1;
 	}
 	if ((new_ns->flags & NAMESPACE_FLAG_UNUSABLE) == 0 &&


More information about the dovecot-cvs mailing list