if (!namespace_is_valid_alias_storage(ns, error_r))
return -1;
+ if ((ns->alias_for->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {
+ /* copy inbox=yes */
+ ns->flags |= NAMESPACE_FLAG_INBOX_USER;
+ }
+
ns->alias_chain_next = ns->alias_for->alias_chain_next;
ns->alias_for->alias_chain_next = ns;
}
ns->prefix);
return FALSE;
}
- if (namespace_set_alias_for(ns, namespaces, error_r) < 0)
- return FALSE;
if ((ns->flags & NAMESPACE_FLAG_HIDDEN) == 0)
visible_namespaces = TRUE;
+ /* check the inbox=yes status before alias_for changes it */
if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {
if (inbox_ns != NULL) {
*error_r = "There can be only one namespace with "
}
inbox_ns = ns;
}
+ if (namespace_set_alias_for(ns, namespaces, error_r) < 0)
+ return FALSE;
+
if (*ns->prefix != '\0' &&
(ns->flags & (NAMESPACE_FLAG_LIST_PREFIX |
NAMESPACE_FLAG_LIST_CHILDREN)) != 0 &&
};
enum namespace_flags {
- /* Namespace contains the user's INBOX mailbox (there can be only
- one) */
+ /* Namespace contains the user's INBOX mailbox. Normally only a single
+ namespace has this flag set, but when using alias_for for the INBOX
+ namespace the flag gets copied to the alias namespace as well */
NAMESPACE_FLAG_INBOX_USER = 0x01,
/* Namespace contains someone's INBOX. This is set for both user's
INBOX namespace and also for any other users' shared namespaces. */