]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Give an error if inbox=yes namespace is missing.
authorTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 01:07:40 +0000 (20:07 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 01:07:40 +0000 (20:07 -0500)
Previously we attempted to set it automatically, but that didn't work.

--HG--
branch : HEAD

src/lib-storage/mail-namespace.c

index 657732bc065a9371551451cfb2107f330f7b2f34..a80ac1e4f0764fb5ff2fc644477333c0a4fddcbd 100644 (file)
@@ -132,8 +132,7 @@ namespace_add_env(const char *data, unsigned int num,
 
 static bool namespaces_check(struct mail_namespace *namespaces)
 {
-       struct mail_namespace *ns, *inbox_ns = NULL, *private_ns = NULL;
-       unsigned int private_ns_count = 0;
+       struct mail_namespace *ns, *inbox_ns = NULL;
        unsigned int subscriptions_count = 0;
        char list_sep = '\0';
 
@@ -147,10 +146,6 @@ static bool namespaces_check(struct mail_namespace *namespaces)
                        }
                        inbox_ns = ns;
                }
-               if (ns->type == NAMESPACE_PRIVATE) {
-                       private_ns = ns;
-                       private_ns_count++;
-               }
                if (*ns->prefix != '\0' &&
                    (ns->flags & NAMESPACE_FLAG_LIST_PREFIX) != 0 &&
                    ns->prefix[strlen(ns->prefix)-1] != ns->sep) {
@@ -181,15 +176,9 @@ static bool namespaces_check(struct mail_namespace *namespaces)
        }
 
        if (inbox_ns == NULL) {
-               if (private_ns_count == 1) {
-                       /* just one private namespace. we'll assume it's
-                          the INBOX namespace. */
-                       private_ns->flags |= NAMESPACE_FLAG_INBOX;
-               } else {
-                       i_error("namespace configuration error: "
-                               "inbox=yes namespace missing");
-                       return FALSE;
-               }
+               i_error("namespace configuration error: "
+                       "inbox=yes namespace missing");
+               return FALSE;
        }
        if (list_sep == '\0') {
                i_error("namespace configuration error: "