location = t_str_new(256);
if (ret > 0)
var_expand(location, storage->location, tab);
- else
+ else {
get_nonexisting_user_location(storage, userdomain, location);
+ ns->flags |= NAMESPACE_FLAG_UNUSABLE;
+ }
if (mail_storage_create(ns, NULL, str_c(location), _storage->flags,
_storage->lock_method, &error) < 0) {
mail_storage_set_critical(_storage, "Namespace '%s': %s",
NAMESPACE_FLAG_AUTOCREATED = 0x2000,
/* Namespace has at least some usable mailboxes. Autocreated namespaces
that don't have usable mailboxes may be removed automatically. */
- NAMESPACE_FLAG_USABLE = 0x4000
+ NAMESPACE_FLAG_USABLE = 0x4000,
+ /* Automatically created namespace for a user that doesn't exist. */
+ NAMESPACE_FLAG_UNUSABLE = 0x8000
};
struct mail_namespace {
if (rootdir == NULL)
return 0;
+ ns = mailbox_list_get_namespace(list);
+ if ((ns->flags & NAMESPACE_FLAG_UNUSABLE) != 0) {
+ /* we can't write anything here */
+ return 0;
+ }
+
path = t_str_new(256);
str_printfa(path, "%s/%s", rootdir, mailbox_list_get_temp_prefix(list));
ret = 0;
acllist_clear(backend, 0);
- ns = mailbox_list_get_namespace(list);
backend->rebuilding_acllist = TRUE;
iter = mailbox_list_iter_init(list, "*", MAILBOX_LIST_ITER_RAW_LIST |