mail-user.c revision 4654f788834c9d7920a351306b89cf5d1c21772e
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2008 Dovecot authors, see the included COPYING file */
d6c5ceea8521b92d10e51a59da00c792f6140b1dTimo Sirainenstruct mail_user_module_register mail_user_module_register = { 0 };
d6c5ceea8521b92d10e51a59da00c792f6140b1dTimo Sirainenvoid (*hook_mail_user_created)(struct mail_user *user) = NULL;
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic void mail_user_deinit_base(struct mail_user *user)
d6c5ceea8521b92d10e51a59da00c792f6140b1dTimo Sirainenstruct mail_user *mail_user_init(const char *username, const char *home)
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen pool = pool_alloconly_create("mail user", 512);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen p_array_init(&user->module_contexts, user->pool, 5);
3ddbbe03fe74b3ee7b1dff4e08ec706d7880d052Timo Sirainenvoid mail_user_deinit(struct mail_user **_user)
d6c5ceea8521b92d10e51a59da00c792f6140b1dTimo Sirainenvoid mail_user_add_namespace(struct mail_user *user, struct mail_namespace *ns)
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen if (strlen(ns->prefix) < strlen((*tmp)->prefix))
15144da8b116d887e6954bc5ec6c86b1a61565e7Timo Sirainenconst char *mail_user_home_expand(struct mail_user *user, const char *path)
923eb3dde28e4d8841c14fd6b4a69635b7070c3eTimo Sirainenint mail_user_try_home_expand(struct mail_user *user, const char **pathp)
a5a0a25a2aa6c85e1bbf0f281d515b45018e190eTimo Sirainen if (path[0] == '~' && (path[1] == '/' || path[1] == '\0')) {