@Override
public void run() {
try (InputStream ins = new BufferedInputStream(socket.getInputStream(), 512);
OutputStream outs = new BufferedOutputStream(socket.getOutputStream(), 1024)
) {
response = new ImapResponse(outs);
String responseBuffer = VERSION + " Server GreenMail v" +
BuildInfo.INSTANCE.getProjectVersion() + " ready";
response.okResponse(null, responseBuffer);
session = new ImapSessionImpl(imapHost,
userManager,
this,
socket.getInetAddress().getHostAddress());
while (requestHandler.handleRequest(ins, outs, session)) {
}
} catch (Exception e) {
log.error("Can not handle IMAP connection", e);
throw new IllegalStateException("Can not handle IMAP connection", e);
} finally {
close();
}
}