dovecot: Mark deliver's dummy mbox namespace as internal and don...

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 22 15:49:43 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/c6849b4a3812
changeset: 6459:c6849b4a3812
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 22 15:49:02 2007 +0300
description:
Mark deliver's dummy mbox namespace as internal and don't include it in
quota calculation.

diffstat:

3 files changed, 6 insertions(+), 2 deletions(-)
src/deliver/deliver.c             |    1 +
src/lib-storage/mail-namespace.h  |    4 +++-
src/plugins/quota/quota-storage.c |    3 ++-

diffs (38 lines):

diff -r cca479cb3ef0 -r c6849b4a3812 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Sat Sep 22 15:14:20 2007 +0300
+++ b/src/deliver/deliver.c	Sat Sep 22 15:49:02 2007 +0300
@@ -760,6 +760,7 @@ int main(int argc, char *argv[])
 		exit(EX_TEMPFAIL);
 
 	mbox_ns = mail_namespaces_init_empty(namespace_pool);
+	mbox_ns->flags |= NAMESPACE_FLAG_INTERNAL;
 	if (mail_storage_create(mbox_ns, "mbox", "/tmp", destination,
 				0, FILE_LOCK_METHOD_FCNTL, &error) < 0)
 		i_fatal("Couldn't create internal mbox storage: %s", error);
diff -r cca479cb3ef0 -r c6849b4a3812 src/lib-storage/mail-namespace.h
--- a/src/lib-storage/mail-namespace.h	Sat Sep 22 15:14:20 2007 +0300
+++ b/src/lib-storage/mail-namespace.h	Sat Sep 22 15:49:02 2007 +0300
@@ -13,7 +13,9 @@ enum namespace_flags {
 	/* Namespace is visible only by explicitly using its full prefix */
 	NAMESPACE_FLAG_HIDDEN	= 0x02,
 	/* Namespace is visible with LIST */
-	NAMESPACE_FLAG_LIST	= 0x04
+	NAMESPACE_FLAG_LIST	= 0x04,
+	/* Namespace is created for internal use only. */
+	NAMESPACE_FLAG_INTERNAL	= 0x10
 };
 
 struct mail_namespace {
diff -r cca479cb3ef0 -r c6849b4a3812 src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Sat Sep 22 15:14:20 2007 +0300
+++ b/src/plugins/quota/quota-storage.c	Sat Sep 22 15:49:02 2007 +0300
@@ -453,7 +453,8 @@ void quota_mail_storage_created(struct m
 
 	MODULE_CONTEXT_SET_SELF(storage, quota_storage_module, qstorage);
 
-	if (storage->ns->type == NAMESPACE_PRIVATE) {
+	if (storage->ns->type == NAMESPACE_PRIVATE &&
+	    (storage->ns->flags & NAMESPACE_FLAG_INTERNAL) == 0) {
 		/* register to user's quota roots */
 		quota_add_user_storage(quota_set, storage);
 	}


More information about the dovecot-cvs mailing list