struct mail_user *user;
struct mail_namespace *ns;
struct mail_namespace_settings *ns_set;
+ struct mail_storage *storage;
struct event *event;
const char *error;
ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
ns->set = ns_set;
- if (mail_storage_create(ns, user->event, 0, &error) < 0)
+ if (mail_storage_create(ns, user->event, 0, &storage, &error) < 0)
i_fatal("Couldn't create internal raw storage: %s", error);
if (mail_namespaces_init_finish(ns, &error) < 0)
i_fatal("Couldn't create internal raw namespace: %s", error);
return -1;
}
+ struct mail_storage *new_storage;
new_storage_flags = _storage->flags &
ENUM_NEGATE(MAIL_STORAGE_FLAG_SHARED_DYNAMIC);
new_storage_flags |= MAIL_STORAGE_FLAG_NO_AUTOVERIFY;
- if (mail_storage_create(new_ns, set_event, new_storage_flags, &error) < 0) {
+ if (mail_storage_create(new_ns, set_event, new_storage_flags,
+ &new_storage, &error) < 0) {
mailbox_list_set_critical(ns->list, "Namespace %s: %s",
new_ns->prefix, error);
/* owner gets freed by namespace deinit */
{
enum mail_storage_flags flags = 0;
struct mail_namespace *ns;
+ struct mail_storage *storage;
const char *error;
int ret;
ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
}
- if (mail_storage_create(ns, set_event, flags, &error) < 0) {
+ if (mail_storage_create(ns, set_event, flags, &storage, &error) < 0) {
*error_r = t_strdup_printf("Namespace %s: %s",
ns->set->name, error);
mail_namespace_free(ns);
{
struct mail_namespace_settings *inbox_set;
struct mail_namespace *ns;
+ struct mail_storage *storage;
int ret;
inbox_set = p_new(user->pool, struct mail_namespace_settings, 1);
SETTINGS_OVERRIDE_TYPE_CODE);
}
- if (mail_storage_create(ns, set_event, 0, error_r) < 0) {
+ if (mail_storage_create(ns, set_event, 0, &storage, error_r) < 0) {
mail_namespace_free(ns);
return -1;
}
}
int mail_storage_create(struct mail_namespace *ns, struct event *set_event,
- enum mail_storage_flags flags, const char **error_r)
+ enum mail_storage_flags flags,
+ struct mail_storage **storage_r, const char **error_r)
{
- struct mail_storage *storage;
int ret;
T_BEGIN {
ret = mail_storage_create_real(ns, set_event, flags,
- &storage, error_r);
+ storage_r, error_r);
} T_END_PASS_STR_IF(ret < 0, error_r);
return ret;
}
/* Create a storage for the namespace. */
int mail_storage_create(struct mail_namespace *ns, struct event *event,
- enum mail_storage_flags flags, const char **error_r);
+ enum mail_storage_flags flags,
+ struct mail_storage **storage_r, const char **error_r);
void mail_storage_unref(struct mail_storage **storage);
/* Returns the mail storage settings. */