]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: shared - Remove check to see if shared namespace's storage exists
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 27 Dec 2023 18:18:18 +0000 (13:18 -0500)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
This doesn't work with imapc when local index files are used, because
mailbox_list_get_root_path() returns the index file location then. Just
because it doesn't exist yet doesn't mean that the namespace is unusable.

There is already a check to verify whether the user exists, which should be
enough.

src/lib-storage/index/shared/shared-storage.c

index 2178dee6261c1aa23130f0eca4880b0de74f5dc2..ae6876db7e1594c217612fa25fadbf61a0a1d7ed 100644 (file)
@@ -113,19 +113,6 @@ get_nonexistent_user_path(struct shared_storage *storage,
                               username);
 }
 
-static bool shared_namespace_exists(struct mail_namespace *ns)
-{
-       const char *path;
-       struct stat st;
-
-       if (!mailbox_list_get_root_path(ns->list, MAILBOX_LIST_PATH_TYPE_DIR,
-                                       &path)) {
-               /* we can't know if this exists */
-               return TRUE;
-       }
-       return stat(path, &st) == 0;
-}
-
 static int
 shared_mail_user_init(struct mail_storage *_storage,
                      struct mail_user *user, struct mail_user *owner,
@@ -445,11 +432,6 @@ shared_mail_user_init(struct mail_storage *_storage,
                event_unref(&set_event);
                return -1;
        }
-       if ((new_ns->flags & NAMESPACE_FLAG_UNUSABLE) == 0 &&
-           !shared_namespace_exists(new_ns)) {
-               /* this user doesn't have a usable storage */
-               new_ns->flags |= NAMESPACE_FLAG_UNUSABLE;
-       }
        /* mark the shared namespace root as usable, since it now has
           child namespaces */
        ns->flags |= NAMESPACE_FLAG_USABLE;