TestMessageHook hook = new TestMessageHook();
InetSocketAddress address = new InetSocketAddress("127.0.0.1", TestUtils.getFreePort());
ProtocolServer server = null;
try {
Protocol protocol = createProtocol(hook);
((SMTPConfigurationImpl) protocol.getConfiguration()).setUseAddressBracketsEnforcement(false);
server = createServer(protocol, address);
server.bind();
SMTPClient client = createClient();
client.connect(address.getAddress().getHostAddress(), address.getPort());