as in global_alt_usernames. If some field doesn't exist, it's "".
Can also be NULL if there are no user_* fields. */
const char **alt_usernames;
+ /* director_username_hash cached, if non-zero */
+ unsigned int director_username_hash_cache;
+
bool destroyed:1;
bool input_blocked:1;
bool login_success:1;
{
const char *error;
- if (!mail_user_hash(client->virtual_user,
- client->set->director_username_hash,
- hash_r, &error)) {
+ if (client->director_username_hash_cache != 0) {
+ /* already set */
+ } else if (!mail_user_hash(client->virtual_user,
+ client->set->director_username_hash,
+ &client->director_username_hash_cache,
+ &error)) {
i_error("Failed to expand director_username_hash=%s: %s",
client->set->director_username_hash, error);
return FALSE;
}
+
+ *hash_r = client->director_username_hash_cache;
return TRUE;
}