sendUntagged(OzImapServer.getGoodbye(), true);
sendUntagged(ImapServer.getGoodbye(), true);
    private void gotoClosedState(boolean connectionStillOpen) {        // Close only once.        synchronized (mCloseLock) {            if (mState == ConnectionState.CLOSED) {                return;            }            if (mSession != null) {                mSession.setHandler(null);                SessionCache.clearSession(mSession.getSessionId(), mSession.getAccountId());                mSession = null;            }            if (connectionStillOpen) {                try {                    if (!mGoodbyeSent) {                        sendUntagged(OzImapServer.getGoodbye(), true);                    }                    mGoodbyeSent = true;                } catch (IOException e) {                    ZimbraLog.imap.info("exception while closing connection", e);                }                mConnection.close();            }            mState = ConnectionState.CLOSED;        }    }