Отрефактори этот C# код:
if (string.IsNullOrWhiteSpace(answer))
{
    return Result.Error;
}

if (answer.Contains("imap service disabled") ||
    answer.Contains("please enable imap access") ||
    answer.Contains("wybrany kanal dostepu nalezy aktywowac w intefejsie") ||
    answer.Contains("acceso denegado, contacte con soporte. access denied, contact support") ||
    answer.Contains("access control filter on user forbids connection") ||
    answer.Contains("your account does not have imap access") ||
    answer.Contains("application password is required") ||
    answer.Contains("no account is not allowed to use imap") ||
    answer.Contains("* bye imap access disabled for this account.") ||
    answer.Contains("no imap4 access not allowed"))
{
    return Result.ImapDisabled;
}

if (Regex.Match(answer, "invalid email login (.*?) or password").Success ||
    answer.Contains("incorrect authentication data") ||
    answer.Contains("no invalid password") ||
    answer.Contains("no _login failure: mismatched password") ||
    answer.Contains("no authentication is required") ||
    answer.Contains("no login invalid userid/password") ||
    answer.Contains("no user not exist") ||
    answer.Contains("no lookup failed ") ||
    answer.Contains("login failed") ||
    answer.Contains("no invalid login") ||
    answer.Contains("authentication failed") ||
    answer.Contains("login not permitted") ||
    answer.Contains("no failed") ||
    answer.Contains("-err [auth] invalid user/password, bye") ||
    answer.Contains("bad username or password") ||
    answer.Contains("-err authentication credentials are invalid") ||
    answer.Contains("invalid user name or password") ||
    answer.Contains("invalid credentials") ||
    answer.Contains("invalid login or password") ||
    answer.Contains("no login bad password") ||
    answer.Contains("no err.login.") ||
    answer.Contains("-err invalid auth or access denied") ||
    answer.Contains("no authentication failure") ||
    answer.Contains("no login login error or password error") ||
    answer.Contains("no login fail.") ||
    answer.Contains("no login login error, user name or password error") ||
    answer.Contains("no login fail to authenticate,") ||
    answer.Contains("no login fail. password is incorrect") ||
    answer.Contains("password wrong or not a valid user") ||
    answer.Contains("no incorrect password or account name") ||
    answer.Contains("invalid login user or pass") ||
    answer.Contains("no login unknown user or incorrect password") ||
    answer.Contains("invalid username or password") ||
    answer.Contains("username and password do not match") ||
    answer.Contains("no login\r\n") ||
    answer.Contains("no authenticate error") ||
    answer.Contains("no password error") ||
    answer.Contains("no login login error password error") ||
    answer.Contains("no login authentication error") ||
    answer.Contains("no invalid user name") ||
    answer.Contains("no invalid user or password") ||
    answer.Contains("no invalid account status: deleted") ||
    answer.Contains("no invalid\r\n") ||
    answer.Contains("-err invalid password or username") ||
    answer.Contains("no incorrect username or password") ||
    answer.Contains("-err authorization failed") ||
    answer.Contains("no login failure") ||
    answer.Contains("-err invalid user/password") ||
    answer.Contains("no login rejected") ||
    answer.Contains("no username or password is incorrect") ||
    answer.Contains("-err incorrect password or account name") ||
    answer.Contains("chybne jmeno nebo heslo") ||
    answer.Contains("-err [auth] invalid login") ||
    answer.Contains("no login: invalid userid/password") ||
    answer.Contains("no login login error") ||
    answer.Contains("username/password incorrect") ||
    answer.Contains("no authfail: error") ||
    answer.Contains("-err maybe your username or password is incorrect") ||
    answer.Contains("no login incorrect"))
{
    return Result.Bad;
}