mail-user.h revision f534c0d42f1470fca8e4ff3493c94927bf600260
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce /* don't access the home directly. It may be set lazily. */
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce const char *_home;
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce /* If non-NULL, fail the user initialization with this error.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce This could be set by plugins that need to fail the initialization. */
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce const char *error;
22a21e910fd216ec1468fe769dcc29f1621a52a4Ondrej Kos ARRAY_DEFINE(hooks, const struct mail_storage_hooks *);
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorce /* Module-specific contexts. See mail_storage_module_id. */
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorce ARRAY_DEFINE(module_contexts, union mail_user_module_context *);
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce /* Either home is set or there is no home for the user. */
c6872e79e8496fd075e20aec0343ade99cca725cSimo Sorce /* User is an administrator. Allow operations not normally allowed
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce for other people. */
7c69221077c780e62f6c536e78675f2dc1c131bcMichal Zidek /* This is an autocreated user (e.g. for shared namespace or
7c69221077c780e62f6c536e78675f2dc1c131bcMichal Zidek lda raw storage) */
aa7202c8ae677becd6c91d6a27a607fe0f3995eePavel Březina /* mail_user_init() has been called */
f9961e5f82e0ef474d6492371bfdf9e74e208a99Pavel Březina /* Shortcut to mail_storage_settings.mail_debug */
9cb46bc62f22e0104f1b41a423b014c281ef5fc2Jakub Hrozek /* If INBOX can't be opened, log an error, but only once. */
bc30ce9b7d588a17e58012e699986f0d6898b791Pavel Březina unsigned int id;
0161a3c5637a0c0092bf54c436bb3d6508d7df26Jakub Hrozekextern struct mail_user_module_register mail_user_module_register;
7a4e3e29196e3abc1746714fcf93624edae89f93Lukas Slebodnikextern struct auth_master_connection *mail_user_auth_master_conn;
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walterstruct mail_user *mail_user_alloc(const char *username,
f3a25949de81f80c136bb073e4a8f504b080c20cJakub Hrozek/* Returns -1 if settings were invalid. */
8394eddba54b5d3e3fda868145e3751247bdbdb2Michal Zidekint mail_user_init(struct mail_user *user, const char **error_r);
7a4e3e29196e3abc1746714fcf93624edae89f93Lukas Slebodnik/* Find another user from the given user's namespaces. */
979e8d8d6ed444007eeff6be5269e8dc5d2bdf68Pavel Reichlstruct mail_user *mail_user_find(struct mail_user *user, const char *name);
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce/* Specify mail location %variable expansion data. */
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorcevoid mail_user_set_vars(struct mail_user *user, uid_t uid, const char *service,
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce/* Return %variable expansion table for the user. */
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorcemail_user_var_expand_table(struct mail_user *user);
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce/* Specify the user's home directory. This should be called also when it's
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce known that the user doesn't have a home directory to avoid the internal
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorcevoid mail_user_set_home(struct mail_user *user, const char *home);
const char *name);