Last Comment Bug 343011 - Searching Organization from LDAP address book yields no results
: Searching Organization from LDAP address book yields no results
Status: RESOLVED FIXED
: fixed1.8.1.2
Product: MailNews Core
Classification: Components
Component: LDAP Integration (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: ---
Assigned To: Mark Banner (:standard8)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-28 11:22 PDT by Alex Brotman
Modified: 2008-07-31 04:30 PDT (History)
3 users (show)
mscott: blocking‑thunderbird2+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch v1 (checked in on trunk and 1.8 branch) (1.10 KB, patch)
2006-11-27 13:52 PST, Mark Banner (:standard8)
mozilla: review+
mozilla: superreview+
mscott: approval‑thunderbird2+
Details | Diff | Review

Description Alex Brotman 2006-06-28 11:22:08 PDT
User-Agent:       Opera/9.00 (Windows NT 5.1; U; en)
Build Identifier: version 1.5.0.4 (20060516)

Using the Advanced Search of the address book in thunderbird, in the list of fields there is "Organization", but searching on this field does not work.  I've only tested this with an LDAP address book.  Assume you have "Abrotman, LLC" for the Organization name and you go to Edit->Search Addresses, and in the drop down and choose "Organization", and "contains" and type in "abr" and then hit the search button.  There are no results, and there should be at least one.

Reproducible: Always

Steps to Reproduce:
1. Create LDAP entry with an Organization (i used organizationName)
2. Use the advanced find to search for it
3. Watch very carefully as it displays no results

Actual Results:  
there are none, that's the problem.

Expected Results:  
It should display the entry which uses "Abrotman, LLC" and any others containing "abr".
Comment 1 Mark Banner (:standard8) 2006-06-29 12:35:38 PDT
If you go into the preferences, and find the Advanced Configuration Editor, change the preference ldap_2.servers.default.attrmap.Company from "company,o" to "o,company". Then restart Thunderbird and try again - does that fix it?

If so, then we either need to change the default (because the standard attribute to use for organizations according to core.schema in openLDAP and rfc2256 is 'o' rather than 'company') or to fix bug 310103 - LDAP search should use all attributes, or both.

Dan - comments?
Comment 2 Alex Brotman 2006-06-29 13:53:09 PDT
Yes, altering the order does work.  If you alter the order/search all, would this be a fix in the next major release?
Comment 3 Mark Banner (:standard8) 2006-11-01 01:59:19 PST
Looking at this the following two preferences:

pref("ldap_2.servers.default.attrmap.Department", "department,departmentnumber,ou,orgunit");
pref("ldap_2.servers.default.attrmap.Company", "company,o");

Don't match the schema we've published at http://wiki.mozilla.org/MailNews:LDAP_Address_Books

As "o" and "ou" are both defined in core.schema, and the others aren't I think we should be putting them first in the list so that we use them by default.

I'd have liked Dan's input on this but he's away for a couple of weeks. I'm reasonably happy to put a patch in without asking Dan (but would prefer to). Scott - what's the timeframe for getting this in before thunderbird 2? Would we be able to grab Dan before he gets back?
Comment 4 Mark Banner (:standard8) 2006-11-26 14:15:54 PST
Dan agrees that we should change the preferences from:

pref("ldap_2.servers.default.attrmap.Department",
"department,departmentnumber,ou,orgunit");
pref("ldap_2.servers.default.attrmap.Company", "company,o");

to:

pref("ldap_2.servers.default.attrmap.Department",
"ou,department,departmentnumber,orgunit");
pref("ldap_2.servers.default.attrmap.Company", "o,company");

So that the default preference would mean that we look up (and possibly store when that's implemented) against the attribute name given in our ldap schema first (which is based on core.schema which defines o and ou). cc'ing Mark and Rich in case they have any comments.
Comment 5 Mark Smith (:mcs) 2006-11-27 10:34:40 PST
I agree that favoring o and ou makes sense, since those are commonly used attributes.  TBird should try to use the most common schema "out of the box" and be configurable to accommodate whatever schema people are using.
Comment 6 Rich Megginson 2006-11-27 10:46:18 PST
The cn attribute is used for this as well, especially in MS Active Directory:
cn=Users,dc=domain,dc=com instead of the usual ou=People.
Comment 7 Mark Banner (:standard8) 2006-11-27 13:52:14 PST
Created attachment 246708 [details] [diff] [review]
Patch v1 (checked in on trunk and 1.8 branch)

Fixes the company and organization default prefs as per the above comments.
Comment 8 David :Bienvenu 2006-11-27 13:54:05 PST
Comment on attachment 246708 [details] [diff] [review]
Patch v1 (checked in on trunk and 1.8 branch)

thx,  Mark
Comment 9 Mark Banner (:standard8) 2006-11-28 04:45:54 PST
(In reply to comment #6)
> The cn attribute is used for this as well, especially in MS Active Directory:
> cn=Users,dc=domain,dc=com instead of the usual ou=People.
> 
I think we'd need to deal with that separately. Possibly adding cn to the department pref. The users can always override the prefs on a per-directory basis anyway. 
Comment 10 Mark Banner (:standard8) 2006-11-28 04:48:04 PST
Comment on attachment 246708 [details] [diff] [review]
Patch v1 (checked in on trunk and 1.8 branch)

Requesting approval on this patch. Simple low risk patch that corrects the search order preferences so that those that are normally used in schemas are defined first and therefore we search correctly for company & department especially when using our alpha schema.
Comment 11 Mark Banner (:standard8) 2006-12-18 13:34:55 PST
Fixed on 1.8 branch as well as trunk now.

Note You need to log in before you can comment on or make changes to this bug.