mail-user.h revision 691f802ef6ec2105079d420ba26b21088402c6da
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen void (*stats_fill)(struct mail_user *user, struct stats *stats);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* User's creator if such exists. For example for autocreated shared
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen mailbox users their creator is the logged in user. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Set if user was created via mail_storage_service. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_storage_service_user *_service_user;
cb3ab2fd5668700a89b274a43595cfbfa1616e4bTimo Sirainen /* don't access the home directly. It may be set lazily. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *const *userdb_fields;
b4a7dbfb4256abcd2f983d56bd032acd55f59591Timo Sirainen const struct var_expand_table *var_expand_table;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* If non-NULL, fail the user initialization with this error.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen This could be set by plugins that need to fail the initialization. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const struct mail_user_settings *unexpanded_set;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen ARRAY(const struct mail_storage_hooks *) hooks;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Filled lazily by mailbox_attribute_*() when accessing attributes. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Module-specific contexts. See mail_storage_module_id. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen ARRAY(union mail_user_module_context *) module_contexts;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* User doesn't exist (as reported by userdb lookup when looking
cb3ab2fd5668700a89b274a43595cfbfa1616e4bTimo Sirainen /* Either home is set or there is no home for the user. */
cb3ab2fd5668700a89b274a43595cfbfa1616e4bTimo Sirainen /* User is anonymous */
4487c66123ca4830f8afbf4efcd7a260848d0e05Timo Sirainen /* This is an autocreated user (e.g. for shared namespace or
4487c66123ca4830f8afbf4efcd7a260848d0e05Timo Sirainen lda raw storage) */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* mail_user_init() has been called */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Shortcut to mail_storage_settings.mail_debug */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* If INBOX can't be opened, log an error, but only once. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Fuzzy search works for this user (FTS enabled) */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* We're running dsync */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Failed to create attribute dict, don't try again */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* We're deinitializing the user */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Enable administrator user commands for the user */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen unsigned int id;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct mail_user_module_register mail_user_module_register;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct auth_master_connection *mail_user_auth_master_conn;
a618726eb3eb09a3866fe93208baf923d593f4d3Timo Sirainenextern const struct var_expand_func_table *mail_user_var_expand_func_table;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct mail_user *mail_user_alloc(const char *username,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Returns -1 if settings were invalid. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenint mail_user_init(struct mail_user *user, const char **error_r);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Duplicate a mail_user. mail_user_init() and mail_namespaces_init() need to
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen be called before the user is usable. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct mail_user *mail_user_dup(struct mail_user *user);
67e0afe62b26d222614b8d817155bf5c74bd7fe0Stephan Bosch/* Find another user from the given user's namespaces. */
67e0afe62b26d222614b8d817155bf5c74bd7fe0Stephan Boschstruct mail_user *mail_user_find(struct mail_user *user, const char *name);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Specify mail location %variable expansion data. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid mail_user_set_vars(struct mail_user *user, const char *service,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Return %variable expansion table for the user. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenmail_user_var_expand_table(struct mail_user *user);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Specify the user's home directory. This should be called also when it's
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen known that the user doesn't have a home directory to avoid the internal
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid mail_user_set_home(struct mail_user *user, const char *home);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Get the home directory for the user. Returns 1 if home directory looked up
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen successfully, 0 if there is no home directory (either user doesn't exist or
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen has no home directory) or -1 if lookup failed. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenint mail_user_get_home(struct mail_user *user, const char **home_r);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Appends path + file prefix for creating a temporary file.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen The file prefix doesn't contain any uniqueness. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid mail_user_set_get_temp_prefix(string_t *dest,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* Returns TRUE if plugin is loaded for the user. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenbool mail_user_is_plugin_loaded(struct mail_user *user, struct module *module);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen/* If name exists in plugin_envs, return its value. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenconst char *mail_user_plugin_getenv(struct mail_user *user, const char *name);
const char *name);
struct mail_storage *