Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-21-2011, 10:03 PM
Senior Member
 
Posts: 51
Default GALsync LDAP query in AD; mailnickname=Bug?

I'm testing a 7.1.2 OSE on Ubuntu 10.04.3 LTS server, with multi-server+multi-domain setup.

I've noticed, when testing the GALsync setup, that one of my domains tests fine (this domain has an existing exchange server), i.e. when I type something into the test field, it does retrieve some results.

However, on another two domains (which have never had exchange installed before), when I type something into the test field, even though it says passed, no results are returned.

According to the output of "zmprov gcf zimbraGalLdapFilterDef | grep ad:", the filter used is:

Code:
(&(|(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)))
So to troubleshoot, I started by building an LDAP query manually, using this:
Code:
(&(|(displayName=*)(cn=*)(sn=*)(givenName=*)(mail=*))(!(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)))
As expected, this works fine in the 1st domain, and returns an empty set for the other two.

So by trial and error, I found that if I delete these two clauses (not one, not the other, but both), the query works:
Code:
	(!(msExchHideFromAddressLists=TRUE))
	(mailnickname=*)
i.e. the query is now just:
Code:
(&(|(displayName=*)(cn=*)(sn=*)(givenName=*)(mail=*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
The values for attribute mailnickname are not populated in my other two domains, so that would explain why the result set is empty, but anybody know why:
1) mailnickname needs to be populated
2) why does the query still not work, by removing just the mailnickname clause?
3) what's a better solution, to populate the mailnickname, or change the zimbraGalLdapFilterDef filter?
4) from some googling, it seems that mailnickname is strictly an MS Exchange attribute, so for non-exchange environments, this would be a bug to be using as a filter?

For better readability, I reformatted the default query so it looks like this (braces matching; you can't use the query like this, so have to replace \t and \n with null):
Code:
(&
	(|(displayName=*)(cn=*)(sn=*)(givenName=*)(mail=*))
	(!(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)
	)
)
__________________
Release 7.1.3_GA_3346.UBUNTU10_64 UBUNTU10_64 FOSS edition
Reply With Quote
  #2 (permalink)  
Old 09-21-2011, 10:08 PM
Senior Member
 
Posts: 51
Default

I found this old bug: https://bugzilla.zimbra.com/show_bug.cgi?id=11562

According to the last updates, it wasn't fixed in 7.1.1 or 7.1.2, but is fixed in 7.1.3?

So looks like the correct fix is to remove the mailnickname clause from the filter, will test...
__________________
Release 7.1.3_GA_3346.UBUNTU10_64 UBUNTU10_64 FOSS edition
Reply With Quote
  #3 (permalink)  
Old 09-21-2011, 11:34 PM
Senior Member
 
Posts: 51
Default

To followup, I configured one of the domains as follows:
1) Configure GAL
2) changed Server type from AD to LDAP
3) without touching anything else, changed the LDAP filter to:
Code:
(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
4) without touching anything else, changed the Autocomplete filter to:
Code:
(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(givenName=%s*)(mail=%s*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
4) testing on the next few panels now work (i.e. I can retrieve results)

Note that if I leave "(!(msExchHideFromAddressLists=TRUE))" in the query, it still fails to retrieve anything. So in the end I had to, as per my testing, take out both the mailnickname and msExchHideFromAddressLists clauses out.
__________________
Release 7.1.3_GA_3346.UBUNTU10_64 UBUNTU10_64 FOSS edition

Last edited by ypong; 09-21-2011 at 11:42 PM..
Reply With Quote
  #4 (permalink)  
Old 10-12-2011, 10:06 PM
Senior Member
 
Posts: 51
Default

Finally, I modifed the queries to excluded disabled accounts:
LDAP filter:
Code:
(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(mail=*%s*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(&(objectCategory=person)(objectClass=contact)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
Autocomplete filter:
Code:
(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(givenName=%s*)(mail=%s*))(|(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(&(objectCategory=person)(objectClass=contact)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)))
Not sure if I can take "(!(userAccountControl:1.2.840.113556.1.4.803:=2)) " and put it further outside as part of the initial &, so I don't need to write that clause three times... more testing...
__________________
Release 7.1.3_GA_3346.UBUNTU10_64 UBUNTU10_64 FOSS edition
Reply With Quote
  #5 (permalink)  
Old 03-10-2012, 11:59 PM
Intermediate Member
 
Posts: 19
Thumbs up Thank you very much!!!

Quote:
Originally Posted by ypong View Post
finally, i modifed the queries to excluded disabled accounts:
Ldap filter:
Code:
(&(|(displayname=*%s*)(cn=*%s*)(sn=*%s*)(givenname=*%s*)(mail=*%s*))(|(&(objectcategory=person)(objectclass=user)(!(homemdb=*))(!(msexchhomeservername=*))(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(&(objectcategory=person)(objectclass=user)(|(homemdb=*)(msexchhomeservername=*))(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(&(objectcategory=person)(objectclass=contact)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(objectcategory=group)(objectcategory=publicfolder)(objectcategory=msexchdynamicdistributionlist)))
autocomplete filter:
Code:
(&(|(displayname=%s*)(cn=%s*)(sn=%s*)(givenname=%s*)(mail=%s*))(|(&(objectcategory=person)(objectclass=user)(!(homemdb=*))(!(msexchhomeservername=*))(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(&(objectcategory=person)(objectclass=user)(|(homemdb=*)(msexchhomeservername=*))(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(&(objectcategory=person)(objectclass=contact)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))(objectcategory=group)(objectcategory=publicfolder)(objectcategory=msexchdynamicdistributionlist)))
not sure if i can take "(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)) " and put it further outside as part of the initial &, so i don't need to write that clause three times... More testing...
wow!!! I have been working on this all day. I thought i had something configured wrong. This did the trick!!! Thank you!
Reply With Quote
  #6 (permalink)  
Old 03-11-2012, 06:48 PM
Senior Member
 
Posts: 51
Default

no worries, glad I could help. I've certainly learnt a lot from the community too.
__________________
Release 7.1.3_GA_3346.UBUNTU10_64 UBUNTU10_64 FOSS edition
Reply With Quote
  #7 (permalink)  
Old 04-17-2012, 12:12 AM
New Member
 
Posts: 3
Default

I'm using for both:
Code:
(&(objectClass=person)(|(useraccountcontrol=66048)(useraccountcontrol=512))(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(givenName=*%s*)(sAMAccountName=%s*)(mail=*%s*)))
but I don't have Exchange.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.