context.opContext = new OperationContext(context.authAccount);
context.opContext = new OperationContext(context.authAccount, isAdminRequest(context));
    public void doPost(HttpServletRequest req, HttpServletResponse resp)    throws ServletException, IOException {        Context context = null;        try {            context = new Context(req, resp, this);            if (!checkAuthentication(req, resp, context)) {                sendError(context, req, resp, "must authenticate");                return;            }            if (isProxyRequest(req, resp, context))                return;            if (context.authAccount != null)                ZimbraLog.addAccountNameToContext(context.authAccount.getName());            ZimbraLog.addIpToContext(context.req.getRemoteAddr());            Mailbox mbox = context.targetMailbox = MailboxManager.getInstance().getMailboxByAccount(context.targetAccount);            if (mbox == null)                throw new UserServletException(HttpServletResponse.SC_BAD_REQUEST, "mailbox not found");            ZimbraLog.addMboxToContext(mbox.getId());            ZimbraLog.mailbox.info("UserServlet (POST): " + context.req.getRequestURL().toString());            context.opContext = new OperationContext(context.authAccount);            GetItemOperation op;            if (context.itemId != null)                op = new GetItemOperation(null, context.opContext, context.targetMailbox, Requester.REST, context.itemId.getId(), MailItem.TYPE_FOLDER);            else                 op = new GetItemOperation(null, context.opContext, context.targetMailbox, Requester.REST, context.itemPath, MailItem.TYPE_FOLDER);            op.schedule();            Folder folder = op.getFolder();            if (folder instanceof Mountpoint) {                // if the target is a mountpoint, proxy the request on to the resolved target                proxyOnMountpoint(req, resp, context, (Mountpoint) folder);                return;            }            // if no format explicitly specified, try to guess it from the Content-Type header            if (context.format == null) {                String ctype = context.req.getContentType();                if (ctype != null) {                    if (ctype.indexOf(';') != -1)                        ctype = ctype.substring(0, ctype.indexOf(';'));                    Formatter fmt = mDefaultFormatters.get(ctype.trim().toLowerCase());                    if (fmt != null)                        context.format = fmt.getType();                }            }            // get the POST body content            long sizeLimit = Provisioning.getInstance().getLocalServer().getLongAttr(Provisioning.A_zimbraFileUploadMaxSize, DEFAULT_MAX_SIZE);            byte[] body = ByteUtil.getContent(req.getInputStream(), req.getContentLength(), sizeLimit);            resolveFormatter(context, folder);            context.formatter.save(body, context, folder);        } catch (NoSuchItemException e) {            resp.sendError(HttpServletResponse.SC_NOT_FOUND, "no such item");        } catch (ServiceException se) {            if (se.getCode() == ServiceException.PERM_DENIED)                sendError(context, req, resp, se.getMessage());            else                throw new ServletException(se);        } catch (UserServletException e) {            // add check for ServiceException root cause?            resp.sendError(e.getHttpStatusCode(), e.getMessage());        } finally {            ZimbraLog.clearContext();        }    }