@Override
  protected Element proxyIfNecessary(Element request, Map<String, Object> context)
      throws ServiceException {
    // if we've explicitly been told to execute here, don't proxy
    ZimbraSoapContext zsc = getZimbraSoapContext(context);
    if (zsc.getProxyTarget() != null) return null;

    // check whether we need to proxy to the home server of a target account
    Provisioning prov = Provisioning.getInstance();
    String[] xpath = getProxiedAccountPath();
    String acctId = (xpath != null ? getXPath(request, xpath) : null);
    if (acctId != null) {
      Account acct = getAccount(prov, AccountBy.id, acctId, zsc.getAuthToken());
      if (acct != null && !Provisioning.onLocalServer(acct))
        return proxyRequest(request, context, acctId);
    }

    return null;
  }