if (account == null) throw AccountServiceException.NO_SUCH_ACCOUNT(accountId);  if (!canAccessAccount(zc, account))
if (account == null) { if (isDomainAdminOnly(zc)) { throw ServiceException.PERM_DENIED("account doesn't exist, unable to determine authorization"); } ZimbraLog.account.warn("DeleteMailbox: account doesn't exist: "+accountId+" (still deleting mailbox)"); } else if (!canAccessAccount(zc, account)) {
    public Element handle(Element request, Map<String, Object> context) throws ServiceException {        ZimbraSoapContext zc = getZimbraSoapContext(context);        Element mreq = request.getElement(AdminService.E_MAILBOX);        String accountId = mreq.getAttribute(AdminService.A_ACCOUNTID);                Account account = Provisioning.getInstance().getAccountById(accountId);        if (account == null)            throw AccountServiceException.NO_SUCH_ACCOUNT(accountId);                if (!canAccessAccount(zc, account))            throw ServiceException.PERM_DENIED("can not access account");                Mailbox mbox = Mailbox.getMailboxByAccountId(accountId, false);        int mailboxId = -1;        if (mbox != null) {            mailboxId = mbox.getId();            mbox.deleteMailbox();        }                String idString = (mbox == null) ?            "<no mailbox for account " + accountId + ">" : Integer.toString(mailboxId);        ZimbraLog.security.info(ZimbraLog.encodeAttrs(            new String[] {"cmd", "DeleteMailbox","id", idString}));                Element response = zc.createElement(AdminService.DELETE_MAILBOX_RESPONSE);        if (mbox != null)            response.addElement(AdminService.E_MAILBOX)            .addAttribute(AdminService.A_MAILBOXID, mailboxId);        return response;    }