HashMap attrs = new HashMap();
HashMap<String, String[]> attrs = new HashMap<String, String[]>();
    private void removeAliasInternal(NamedEntry entry, String alias, String[] aliases) throws ServiceException {                DirContext ctxt = null;        try {            ctxt = LdapUtil.getDirContext(true);                        int loc = alias.indexOf("@");             if (loc == -1)                throw ServiceException.INVALID_REQUEST("alias must include the domain", null);            alias = alias.toLowerCase();            boolean found = false;            for (int i=0; !found && i < aliases.length; i++) {                found = aliases[i].equalsIgnoreCase(alias);            }                        if (!found)                throw AccountServiceException.NO_SUCH_ALIAS(alias);                        String aliasDomain = alias.substring(loc+1);            String aliasName = alias.substring(0, loc);            Domain domain = getDomainByName(aliasDomain, ctxt);            if (domain == null)                throw AccountServiceException.NO_SUCH_DOMAIN(aliasDomain);                        String aliasDn = LdapProvisioning.emailToDN(aliasName, aliasDomain);                                    // remove zimbraMailAlias attr first, then alias            try {                HashMap attrs = new HashMap();                attrs.put(Provisioning.A_mail, removeMultiValue(entry, Provisioning.A_mail, alias));                attrs.put(Provisioning.A_zimbraMailAlias, removeMultiValue(entry, Provisioning.A_zimbraMailAlias, alias));                                ((LdapNamedEntry)entry).modifyAttrsInternal(ctxt, attrs);            } catch (ServiceException e) {                ZimbraLog.account.warn("unable to remove zimbraMailAlias/mail attrs: "+alias);                // try to remove alias            }            // remove address from all DLs            removeAddressFromAllDistributionLists(alias);            try {                Attributes aliasAttrs = ctxt.getAttributes(aliasDn);                // make sure aliasedObjectName points to this account                Attribute a = aliasAttrs.get(Provisioning.A_zimbraAliasTargetId);                if ( a != null && ( (String)a.get()).equals(entry.getId())) {                    ctxt.unbind(aliasDn);                    removeAddressFromAllDistributionLists(alias); // doesn't throw exception                } else {                    ZimbraLog.account.warn("unable to remove alias object: "+alias);                }                            } catch (NameNotFoundException e) {                ZimbraLog.account.warn("unable to remove alias object: "+alias);                            }        } catch (NamingException e) {            ZimbraLog.account.error("unable to remove alias: "+alias, e);                            throw ServiceException.FAILURE("unable to remove alias", e);        } finally {            LdapUtil.closeContext(ctxt);        }            }