Difference between revisions of "King0770-Notes-SearchGal-Edit"

Line 64: Line 64:
 
Next, go to the web client. Search for a company, and make sure you select "Global Address List".
 
Next, go to the web client. Search for a company, and make sure you select "Global Address List".
  
<strong>It should be noted, this does not work in 7.x.</strong>
+
<strong>It should be noted, this does not work in 7.x.</strong><br>
 +
<strong> Notable bug:</strong>http://bugzilla.zimbra.com/show_bug.cgi?id=75880
  
 
[[Category: Community Sandbox]]
 
[[Category: Community Sandbox]]
 
[[Category: LDAP]]
 
[[Category: LDAP]]

Revision as of 15:34, 5 July 2012


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 zimbraAccounts 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".

It should be noted, this does not work in 7.x.
Notable bug:http://bugzilla.zimbra.com/show_bug.cgi?id=75880

Jump to: navigation, search