use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method cosesByMailHostPool.
@Test
public void cosesByMailHostPool() throws Exception {
String SERVER_ID = genUUID();
String filter = LegacyLdapFilter.cosesByMailHostPool(SERVER_ID);
ZLdapFilter zLdapFilter = filterDactory.cosesByMailHostPool(SERVER_ID);
verify(FilterId.COSES_BY_MAILHOST_POOL, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method bug64260.
@Test
@Bug(bug = 64260)
public void bug64260() throws Exception {
String badStringFilter = "ad:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*(EMC)))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))";
ZLdapFilter filter;
boolean caughtException = false;
try {
filter = filterDactory.fromFilterString(FilterId.UNITTEST, badStringFilter);
} catch (LdapException e) {
// e.printStackTrace();
if (LdapException.INVALID_SEARCH_FILTER.equals(e.getCode())) {
caughtException = true;
}
}
assertTrue(caughtException);
String goodStringFilter = "(&(|(displayName=*)(cn=*)(sn=*)(givenName=*)(mail=*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*\\28EMC\\29))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))";
// String goodStringFilter = "(displayName=*\\28EMC\\29)";
filter = filterDactory.fromFilterString(FilterId.UNITTEST, goodStringFilter);
// System.out.println(filter.toFilterString());
/*
DEV:
zmprov mcf -zimbraGalLdapFilterDef 'zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))'
zmprov mcf +zimbraGalLdapFilterDef 'zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource))(!(displayName=*\28EMC\29)))'
DF:
zmprov mds galsync@zimbra.com VMware -zimbraGalSyncLdapFilter '(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*EMC))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))'
zmprov mds galsync@zimbra.com VMware +zimbraGalSyncLdapFilter '(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*\28EMC\29))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))'
zmprov mcf -zimbraGalLdapFilterDef 'ad:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*EMC))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))'
zmprov mcf +zimbraGalLdapFilterDef 'ad:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))(!(displayName=*\28EMC\29))(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))'
*/
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method serverById.
@Test
public void serverById() throws Exception {
String ID = genUUID();
String filter = LegacyLdapFilter.serverById(ID);
ZLdapFilter zLdapFilter = filterDactory.serverById(ID);
verify(FilterId.SERVER_BY_ID, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method domainByForeignName.
@Test
public void domainByForeignName() throws Exception {
String FOREIGN_NAME = getTestName();
String filter = LegacyLdapFilter.domainByForeignName(FOREIGN_NAME);
ZLdapFilter zLdapFilter = filterDactory.domainByForeignName(FOREIGN_NAME);
verify(FilterId.DOMAIN_BY_FOREIGN_NAME, filter, zLdapFilter);
}
use of com.zimbra.cs.ldap.ZLdapFilter in project zm-mailbox by Zimbra.
the class TestLdapZLdapFilter method domainLockedForEagerAutoProvision.
@Test
public void domainLockedForEagerAutoProvision() throws Exception {
String filter = LegacyLdapFilter.domainLockedForEagerAutoProvision();
ZLdapFilter zLdapFilter = filterDactory.domainLockedForEagerAutoProvision();
verify(FilterId.DOMAIN_LOCKED_FOR_AUTO_PROVISION, filter, zLdapFilter);
}
Aggregations