static int init_namespaces(struct client *client, bool already_logged_in)
{
const char *error;
+ int ret;
/* finish initializing the user (see comment in main()) */
- if (mail_namespaces_init(client->user, &error) < 0) {
+ ret = mail_namespaces_init(client->user, &error);
+ if (ret == 0) {
+ i_assert(client->inbox_ns == NULL);
+ client->inbox_ns = mail_namespace_find_inbox(client->user->namespaces);
+ i_assert(client->inbox_ns != NULL);
+
+ ret = settings_get(mail_namespace_get_event(client->inbox_ns),
+ &mail_storage_setting_parser_info, 0,
+ &client->mail_set, &error);
+ }
+
+ if (ret < 0) {
if (!already_logged_in)
client_send_line(client, MSG_BYE_INTERNAL_ERROR);
client_destroy(client, error);
return -1;
}
-
- i_assert(client->inbox_ns == NULL);
- client->inbox_ns = mail_namespace_find_inbox(client->user->namespaces);
- i_assert(client->inbox_ns != NULL);
-
return 0;
}
}
path = t_strdup_printf("%s/"POP3_LOCK_FNAME, dir);
- const struct mail_storage_settings *mail_set =
- mail_user_set_get_storage_set(client->user);
dotlock_set = session_dotlock_set;
- dotlock_set.use_excl_lock = mail_set->dotlock_use_excl;
- dotlock_set.nfs_flush = mail_set->mail_nfs_storage;
+ dotlock_set.use_excl_lock = client->mail_set->dotlock_use_excl;
+ dotlock_set.nfs_flush = client->mail_set->mail_nfs_storage;
ret = file_dotlock_create(&dotlock_set, path, 0,
&client->session_dotlock);
client->user = user;
- const struct mail_storage_settings *mail_set =
- mail_user_set_get_storage_set(client->user);
- client->uidl_keymask =
- parse_uidl_keymask(mail_set->pop3_uidl_format);
- if (client->uidl_keymask == 0)
- i_fatal("Invalid pop3_uidl_format");
-
if (var_has_key(set->pop3_logout_format, 'u', "uidl_change")) {
/* logging uidl_change. we need hashes of the UIDLs */
client->message_uidls_save = TRUE;
/* refresh proctitle before a potentially long-running init_mailbox() */
pop3_refresh_proctitle();
+ client->uidl_keymask =
+ parse_uidl_keymask(client->mail_set->pop3_uidl_format);
+ if (client->uidl_keymask == 0)
+ i_fatal("Invalid pop3_uidl_format");
+
flags = MAILBOX_FLAG_POP3_SESSION;
if (!client->set->pop3_no_flag_updates)
flags |= MAILBOX_FLAG_DROP_RECENT;
mail_user_autoexpunge(client->user);
mail_user_deinit(&client->user);
settings_free(client->set);
+ settings_free(client->mail_set);
pop3_client_count--;
DLLIST_REMOVE(&pop3_clients, client);
};
const char *error;
- const struct mail_storage_settings *mail_set =
- mail_user_set_get_storage_set(client->user);
- if (var_expand(str, mail_set->pop3_uidl_format,
+ if (var_expand(str, client->mail_set->pop3_uidl_format,
tab, &error) <= 0) {
e_error(client->event,
"UIDL: Failed to expand pop3_uidl_format=%s: %s",
- mail_set->pop3_uidl_format, error);
+ client->mail_set->pop3_uidl_format, error);
return -1;
}
return 0;