void director_kill_user(struct director *dir, struct director_host *src,
struct user *user, struct mail_tag *tag,
- struct mail_host *old_host)
+ struct mail_host *old_host, bool forced_kick)
{
struct director_kill_context *ctx;
const char *cmd;
director_user_move_timeout, user);
ctx->kill_state = USER_KILL_STATE_KILLING;
- if (old_host != NULL && old_host != user->host) {
+ if ((old_host != NULL && old_host != user->host) || forced_kick) {
cmd = t_strdup_printf("proxy\t*\tKICK-DIRECTOR-HASH\t%u",
user->username_hash);
ctx->callback_pending = TRUE;
user->username_hash, net_ip2addr(&user->host->ip)));
/* kill the user only after sending the USER-MOVE, because the kill
may finish instantly. */
- director_kill_user(dir, src, user, host->tag, old_host);
+ director_kill_user(dir, src, user, host->tag, old_host, FALSE);
}
static void
struct user *user) ATTR_NULL(3);
void director_kill_user(struct director *dir, struct director_host *src,
struct user *user, struct mail_tag *tag,
- struct mail_host *old_host);
+ struct mail_host *old_host, bool forced_kick);
void director_move_user(struct director *dir, struct director_host *src,
struct director_host *orig_src,
unsigned int username_hash, struct mail_host *host)
/* there are no more available backends.
kick the user instead. */
director_kill_user(dir, dir->self_host, user,
- user->host->tag, user->host);
+ user->host->tag, user->host,
+ TRUE);
users_killed = TRUE;
}
} T_END;