ZimbraSoapContext lc = getZimbraSoapContext(context); Account acct = getRequestedAccount(lc); Mailbox mbox = getRequestedMailbox(lc); OperationContext octxt = lc.getOperationContext();
ZimbraSoapContext zsc = getZimbraSoapContext(context); Account acct = getRequestedAccount(zsc); Mailbox mbox = getRequestedMailbox(zsc); OperationContext octxt = zsc.getOperationContext();
    public Element handle(Element request, Map<String, Object> context) throws ServiceException {        ZimbraSoapContext lc = getZimbraSoapContext(context);        Account acct = getRequestedAccount(lc);        Mailbox mbox = getRequestedMailbox(lc);        OperationContext octxt = lc.getOperationContext();        Session session = getSession(context);        mLog.info("<SendMsg> " + lc.toString());        boolean needCalendarSentByFixup =            request.getAttributeBool(MailService.A_NEED_CALENDAR_SENTBY_FIXUP, false);        // <M>        Element msgElem = request.getElement(MailService.E_MSG);        boolean saveToSent = acct.saveToSent();        // check to see whether the entire message has been uploaded under separate cover        String attachment = msgElem.getAttribute(MailService.A_ATTACHMENT_ID, null);        // holds return data about the MimeMessage        MimeMessageData mimeData = new MimeMessageData();        MimeMessage mm;        if (attachment != null) {            mm = parseUploadedMessage(lc, attachment, mimeData);        } else {            mm = ParseMimeMessage.parseMimeMsgSoap(lc, mbox, msgElem, null, mimeData);        }        int origId = (int) msgElem.getAttributeLong(MailService.A_ORIG_ID, 0);        String replyType = msgElem.getAttribute(MailService.A_REPLY_TYPE, MailSender.MSGTYPE_REPLY);        SendMsgOperation op = new SendMsgOperation(session, octxt, mbox, Requester.SOAP,                    saveToSent, mm,                    mimeData.newContacts, mimeData.uploads,                    origId, replyType, false, needCalendarSentByFixup);        op.schedule();        int msgId = op.getMsgId();        Element response = lc.createElement(MailService.SEND_MSG_RESPONSE);        Element respElement = response.addElement(MailService.E_MSG);        if (saveToSent && msgId > 0)            respElement.addAttribute(MailService.A_ID, msgId);        return response;    }