King0770-Notes-SearchGal-Edit

Revision as of 14:50, 14 May 2009 by King0770 (talk | contribs)


If you ever wanted to search in the GAL based on postalCode, street, and company, you can modify the Global config setting for zimbraGalLdapFilterDef.

Basically, you need to modify the zimbraAccounts for the zimbraGalLdapFilterDef setting.

In our example, we'll add (company=*%s*)(postalCode=*%s*)(street=*%s*)

First, to make things easy, lets create an input file; zmprov can take commands from an input file. i.e., zmprov < /tmp/someiputFile

To create the input file:

zmprov gcf zimbraGalLdapFilterDef >> /tmp/editSearchGal

Next you'll need to edit the input file to include (company=*%s*)(postalCode=*%s*)(street=*%s*).
Here's an example of what you should be looking for; extra search settings added. Look for the line "zimbraGalLdapFilterDef: zimbraAccounts:"

zimbraGalLdapFilterDef: zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)
(zimbraMailAlias=*%s*)(company=*%s*)(postalCode=*%s*)(street=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))
(!(objectclass=zimbraCalendarResource)))

My rationale for making an input file is because, zimbraGalLdapFilterDef is a multi-valued attribute, and can be tricky to change by command line. Using the input file can be useful in case you need to make a lot of adjustments.

Below is an example of the inut file. Note the first line is for clearing the zimbraGalLdapFilterDef attribute which is necessary. Also, note our new changes to the zimbraA ccounts line.

We'll call the input file, /tmp/editSearchGal


mcf zimbraGalLdapFilterDef ""
mcf +zimbraGalLdapFilterDef externalLdapAutoComplete:(|(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*))
mcf +zimbraGalLdapFilterDef zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)
(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))
mcf +zimbraGalLdapFilterDef zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)
(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))
mcf +zimbraGalLdapFilterDef zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)
(zimbraMailAlias=*%s*)(company=*%s*)(postalCode=*%s*)(street=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))
(!(objectclass=zimbraCalendarResource)))
mcf +zimbraGalLdapFilterDef zimbraResourceAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)
(zimbraMailAlias=%s*))(objectclass=zimbraCalendarResource))
mcf +zimbraGalLdapFilterDef zimbraResourceSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)
(zimbraMailAlias=*%s*))(objectclass=zimbraCalendarResource))
mcf +zimbraGalLdapFilterDef zimbraResources:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)
(zimbraMailAlias=*%s*))(objectclass=zimbraCalendarResource))
mcf +zimbraGalLdapFilterDef ad:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(!(msExchHideFromAddressLists=TRUE))
(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)
(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)
(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
mcf +zimbraGalLdapFilterDef adAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(givenName=%s*)(mail=%s*))(!(msExchHideFromAddressLists=TRUE))
(mailnickname=*)(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)
(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)
(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))

fc config

After creating the /tmp/editSearchGal file, run the following:

zmprov < /tmp/editSearchGal

Next, go to the web client. Search for a company, and make sure you select "Global Address List".

Jump to: navigation, search