client->urlauth_ctx = imap_urlauth_init(client->user, &config);
}
-static bool user_has_special_use_mailboxes(struct mail_user *user)
-{
- const struct mail_storage_settings *mail_set =
- mail_user_set_get_storage_set(user);
- return mail_set->parsed_have_special_use_mailboxes;
-}
-
struct client *client_create(int fd_in, int fd_out,
enum client_create_flags flags,
struct event *event, struct mail_user *user,
}
if (set->imap_metadata && have_mailbox_attribute_dict)
client_add_capability(client, "METADATA");
- if (user_has_special_use_mailboxes(user)) {
+ if (user->have_special_use_mailboxes) {
/* Advertise SPECIAL-USE only if there are actually some
SPECIAL-USE flags in mailbox configuration. */
client_add_capability(client, "SPECIAL-USE");
}
return TRUE;
}
+/* </settings checks> */
static int
mail_storage_settings_find_ns(struct event *event,
- struct mail_storage_settings *set,
+ const struct mail_storage_settings *set,
const char *wanted_name,
const struct mail_namespace_settings **ns_r,
const char **error_r)
return 0;
}
-bool mail_storage_settings_check_namespaces(struct event *event,
- struct mail_storage_settings *set,
- const char **error_r)
+bool mail_user_check_namespace_settings(struct mail_user *user,
+ const struct mail_storage_settings *set,
+ const char **error_r)
{
const struct mail_namespace_settings *ns, *alias_ns;
const char *ns_name, *error;
return TRUE;
array_foreach_elem(&set->namespaces, ns_name) {
- if (settings_get_filter(event, "namespace", ns_name,
+ if (settings_get_filter(user->event, "namespace", ns_name,
&mail_namespace_setting_parser_info,
SETTINGS_GET_FLAG_FAKE_EXPAND,
&ns, &error) < 0) {
}
if (ns->parsed_have_special_use_mailboxes)
- set->parsed_have_special_use_mailboxes = TRUE;
+ user->have_special_use_mailboxes = TRUE;
if (ns->alias_for[0] == '\0') {
settings_free(ns);
continue;
}
- if (mail_storage_settings_find_ns(event, set,
+ if (mail_storage_settings_find_ns(user->event, set,
ns->alias_for, &alias_ns, error_r) < 0) {
settings_free(ns);
return FALSE;
return TRUE;
}
+/* <settings checks> */
static bool
mailbox_list_get_path_setting(const char *key, const char **value,
pool_t pool, enum mailbox_list_path_type *type_r)
bool parsed_mail_attachment_exclude_inlined;
bool parsed_mail_attachment_detection_add_flags;
bool parsed_mail_attachment_detection_no_flags_on_fetch;
- bool parsed_have_special_use_mailboxes;
/* Filename part of mailbox_list_index_prefix */
const char *parsed_list_index_fname;
/* Directory part of mailbox_list_index_prefix. NULL defaults to index
void mail_storage_2nd_settings_reset(struct settings_instance *instance,
const char *key_prefix);
-bool mail_storage_settings_check_namespaces(struct event *event,
- struct mail_storage_settings *set,
- const char **error_r);
+bool mail_user_check_namespace_settings(struct mail_user *user,
+ const struct mail_storage_settings *set,
+ const char **error_r);
#endif
if (settings_get(user->event, &mail_storage_setting_parser_info, 0,
&user->_mail_set, &error) < 0 ||
- !mail_storage_settings_check_namespaces(user->event,
- user->_mail_set, &error))
+ !mail_user_check_namespace_settings(user, user->_mail_set, &error))
user->error = p_strdup(user->pool, error);
else
mail_user_expand_plugins_envs(user, user->_mail_set);
bool stats_enabled:1;
/* This session was restored (e.g. IMAP unhibernation) */
bool session_restored:1;
+ /* TRUE if any mailboxes have special_use flags */
+ bool have_special_use_mailboxes;
};
struct mail_user_module_register {