sImapServer = new ImapServer(threads, serverSocket, loginOK, false); sImapServer.setSSL(false); sImapServer.setHostname(server);  Thread imap = new Thread(sImapServer); imap.setName("ImapServer"); imap.start();
if (LC.get("debug_ozimap_enable").equalsIgnoreCase("true")) { ZimbraLog.imap.warn("Enabling NIO based non-SSL IMAP server, it does not support STARTTLS yet!"); OzConnectionHandlerFactory imapHandlerFactory = new OzConnectionHandlerFactory() { public OzConnectionHandler newConnectionHandler(OzConnection conn) { return new OzImapConnectionHandler(conn); } };  int readBufferSize = 1000; try { OzServer ozserver = new OzServer("IMAP", readBufferSize, serverSocket, imapHandlerFactory, ZimbraLog.imap); ozserver.setProperty(OzImapConnectionHandler.PROPERTY_ALLOW_CLEARTEXT_LOGINS, Boolean.toString(loginOK)); if (LC.get("debug_ozimap_snoop").equalsIgnoreCase("true")) { ozserver.setSnooper(new OzSnooper(ZimbraLog.imap, OzSnooper.ALL)); } ozserver.start(); sImapServer = ozserver; } catch (IOException ioe) { Zimbra.halt("failed to create OzServer for IMAP", ioe); } } else { ImapServer imapServer = new ImapServer(threads, serverSocket, loginOK, false); imapServer.setSSL(false); sImapServer = imapServer; Thread imap = new Thread(imapServer); imap.setName("ImapServer"); imap.start(); }
    public synchronized static void startupImapServer() throws ServiceException {        if (sImapServer != null)            return;                Server server = Provisioning.getInstance().getLocalServer();        int threads = server.getIntAttr(Provisioning.A_zimbraImapNumThreads, 10);        boolean loginOK = server.getBooleanAttr(Provisioning.A_zimbraImapCleartextLoginEnabled, false);        String address = server.getAttr(Provisioning.A_zimbraImapBindAddress, null);        int port = server.getIntAttr(Provisioning.A_zimbraImapBindPort, Config.D_IMAP_BIND_PORT);        ServerSocket serverSocket = NetUtil.getBoundServerSocket(address, port, false);        sImapServer = new ImapServer(threads, serverSocket, loginOK, false);        sImapServer.setSSL(false);        sImapServer.setHostname(server);                Thread imap = new Thread(sImapServer);        imap.setName("ImapServer");        imap.start();                }