mConnection.setWriteQueueMaxCapacity(config.getIntAttr(Provisioning.A_zimbraMtaMaxMessageSize, ImapServer.IMAP_WRITE_QUEUE_MAX_SIZE));
int msgMax = config.getIntAttr(Provisioning.A_zimbraMtaMaxMessageSize, lcMax); mConnection.setWriteQueueMaxCapacity(Math.max(lcMax, msgMax));
    boolean login(String authenticateId, String username, String password, String command, String tag) throws IOException {        // the Windows Mobile 5 hacks are enabled by appending "/wm" to the username        EnabledHack hack = EnabledHack.NONE;        if (username.endsWith("/wm")) {            username = username.substring(0, username.length() - 3);            hack = EnabledHack.WM5;        }        try {            Account account = authenticate(authenticateId, username, password, command, tag);            ImapSession session = startSession(account, hack, command, tag);            if (session == null)                return CONTINUE_PROCESSING;            // Session timeout will take care of closing an IMAP connection with no activity.            ZimbraLog.imap.debug("disabling unauth connection alarm");            mConnection.cancelAlarm();                        com.zimbra.cs.account.Config config = Provisioning.getInstance().getConfig();                        mConnection.setWriteQueueMaxCapacity(config.getIntAttr(Provisioning.A_zimbraMtaMaxMessageSize, ImapServer.IMAP_WRITE_QUEUE_MAX_SIZE));        } catch (ServiceException e) {            if (mSession != null)                mSession.clearTagCache();            ZimbraLog.imap.warn(command + " failed", e);            if (e.getCode() == AccountServiceException.CHANGE_PASSWORD)                sendNO(tag, "[ALERT] password must be changed before IMAP login permitted");            else if (e.getCode() == AccountServiceException.MAINTENANCE_MODE)                sendNO(tag, "[ALERT] account undergoing maintenance; please try again later");            else                sendNO(tag, command + " failed");            return canContinue(e);        }                sendCapability();        sendOK(tag, command + " completed");        return CONTINUE_PROCESSING;    }