if ((host == null) || (host.length() < 1))
errors.addError("error.host.required");
if ((username == null) || (username.length() < 1))
errors.addError("error.username.required");
if ((password == null) || (password.length() < 1))
errors.addError("error.password.required");
if ((type == null) || (type.length() < 1))
errors.addError("error.type.required");
else if (!"imap".equals(type) && !"pop3".equals(type))
errors.addError("error.type.invalid");