// authenticate mailbox, if failed return null
AccountStatus status = validator.getAccountStatus(username);
session.getLogger().debug("Validated account (" + username + ") status is " + status.toString());
if (!status.equals(AccountStatus.ACTIVE)) {
throw new AuthenticationException("User " + username + " does not exist or inactive");
}
// authenticate user with password
mailbox = authenticator.authenticate(username, password);