MailNews:LDAP Address Books: Difference between revisions

m (→‎LDAP Address Book Schema - Alpha Version: Make discussion page link be the one to that proper talk page.)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Mailnews Address Book Resources}}
== LDAP Logging ==
== LDAP Logging ==


We have now enabled LDAP Logging on Release builds on the trunk and the 1.8.1 branch (aka SeaMonkey 1.1a/Thunderbird 2.0a)
The LDAP logging can be used to view the messages that the Address Book is sending and receiving to/from your LDAP server. We hope that this will aid debugging problems on an LDAP link.


The LDAP logging can be used to view the messages that the Address Book is sending and receiving to/from your LDAP server. We hope that this will aid debugging problems on an LDAP link.
To enable logging set the environment variable "NSPR_LOG_MODULES" to ldap:5 (see links below for how to do this) and start up Address Book, then attempt an LDAP search or autocomplete and the connection/message process will be logged to the console.


To enable logging set the environment variable "NSPR_LOG_MODULES" to ldap:5 and start up Address Book, then attempt an LDAP search or autocomplete and the connection/message process will be logged to the console.
For ease of logging, you may wish to also set the NSPR_LOG_FILE to a file location so that you don't need to capture the file output. See the links below on how to set this up.


See these links for more detail:
See these links for more detail:


* [http://www.mozilla.org/quality/mailnews/mail-troubleshoot.html Troubleshooting Mail/News]
* [[Mailnews:Logging]]
* [http://www.mozilla.org/projects/nspr/reference/html/prlog.html NSPR Logging]
 
Trunk nightlies are available from:
 
* [ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-trunk/ SeaMonkey]
* [ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/ Thunderbird]
 
Branch nightlies are available from:
 
* [ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/contrib/latest-mozilla1.8/ SeaMonkey]
* [ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-mozilla1.8/ Thunderbird]
 
== LDAP Address Book Schema - Alpha Version ==
 
This is the current alpha version of the Mozilla LDAP Address Book Schema. It will work with Thunderbird 1.5 and SeaMonkey 1.0 (both including alpha/beta versions).
 
To use it copy the text below into a file and point you LDAP server at it. With this specification you won't need to change any of the LDAP default attributes.
 
If you find any problems with this schema, they should be filed here on the [[MailNews_Talk:LDAP Address Books]] discussion page, bugs with Thunderbird or SeaMonkey should be filed in [https://bugzilla.mozilla.org/ bugzilla].
 
Any Updates to the schema will be documented in the header.
 
----
 
# Mozilla: @VERSION@
#
# mozillaAbPersonAlpha
#
# Created initial version --[[User:Standard8|Standard8]] 12:21, 5 Dec 2005 (PST)
#
# This file contains LDAPv3 schema for use with the Mozilla Address Book
# and is intended to ...
 
# Depends upon
#  Definition of an X.500 Attribute Type and an Object Class to Hold
#  Uniform Resource Identifiers (URIs) [RFC2079], and A Summary of
#  the X.500(96) User Schema for use with LDAPv3 [RFC2256] (core.schema)
#
#  The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)
#
#  The InetOrgPerson Schema [RFC2798] (inetorgperson.schema)
 
# 1.3.6.1.4.1.13769.4.x - Mozilla AB 'Other' tab
 
attributetype ( 1.3.6.1.4.1.13769.4.1 NAME 'mozillaCustom1'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.13769.4.2 NAME 'mozillaCustom2'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
 
attributetype ( 1.3.6.1.4.1.13769.4.3 NAME 'mozillaCustom3'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.13769.4.4 NAME 'mozillaCustom4'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
# 1.3.6.1.4.1.13769.3.x - Mozilla AB 'Address' tab


attributetype ( 1.3.6.1.4.1.13769.3.1 NAME 'mozillaHomeStreet'
== LDAP Address Book Schema ==
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.2 NAME 'mozillaHomeStreet2'
The address book code specifies default settings for communicating with LDAP servers.
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.3 NAME 'mozillaHomeLocalityName'
The default settings are specified in a [[MailNews:Mozilla LDAP Address Book Schema|defined schema]], currently in an alpha version. Setting up a LDAP server with this schema, and setting up the address book (Thunderbird or SeaMonkey) to talk to that LDAP server will enable all fields to work correctly.
        SUP name SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.4 NAME 'mozillaHomeState'
== Overriding the default schema for LDAP address books ==
        SUP name SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.5 NAME 'mozillaHomePostalCode'
As of SeaMonkey 1.0 and Thunderbird 1.5 it is possible to override some aspects of the default LDAP schema for address books.
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.6 NAME 'mozillaHomeCountryName'
This can either be done for all LDAP address books, or for individual ones.
        SUP name SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.7 NAME 'mozillaHomeUrl'
=== Globally overriding the default LDAP schema ===
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.8 NAME 'mozillaWorkStreet2'
In preferences (about:config/prefs.js) there are a set of preferences prefixed by "ldap_2.servers.default.attrmap.". For example:
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.9 NAME 'mozillaWorkUrl'
<pre>
        EQUALITY caseIgnoreMatch
pref("ldap_2.servers.default.attrmap.FirstName", "givenName");
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
pref("ldap_2.servers.default.attrmap.LastName", "sn,surname");
pref("ldap_2.servers.default.attrmap.DisplayName", "cn,commonname");
# 1.3.6.1.4.1.13769.2.x - Mozilla AB 'Contact' tab
pref("ldap_2.servers.default.attrmap.NickName", "mozillaNickname,xmozillanickname");
pref("ldap_2.servers.default.attrmap.PrimaryEmail", "mail");
pref("ldap_2.servers.default.attrmap.Company", "o,company");
</pre>


attributetype ( 1.3.6.1.4.1.13769.2.1
By changing these values (comma-separated lists), you are able to override the default mapping for address book attributes.
        NAME ( 'mozillaNickname' 'xmozillanickname' )
        SUP name )


attributetype ( 1.3.6.1.4.1.13769.2.2
Taking the Company case, it is by default set to look up the "o" attribute first, if it doesn't find it to be present, it will look up the "company" attribute instead. Note that when searching for items, the address book will only search for the first attribute, i.e. "o" in this case.
        NAME ( 'mozillaSecondEmail' 'xmozillasecondemail' )
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.2.3
So changing "ldap_2.servers.default.attrmap.Company" to "organization,o,company" will cause the address book when searching for Companies, to look at the "organization" attribute, and to prioritise the organization attribute when pulling out values to display.
        NAME ( 'mozillaUseHtmlMail' 'xmozillausehtmlmail' )
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )


# AOL Instant Messenger (AIM) Identity
Note: You can only use each attribute once in the prefs, i.e. you can't set both FirstName and DisplayName to "cn".
attributetype ( 1.3.6.1.4.1.13769.2.4
        NAME ( 'nsAIMid' 'nscpaimscreenname' )
        EQUALITY telephoneNumberMatch
        SUBSTR telephoneNumberSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )


# 1.3.6.1.4.1.13769.9 - Mozilla AB objectclasses
=== Overriding individual LDAP Address Book Schemas ===
# The mozillaAddressBookEntry object class is used to define entries
# representing Cards in the Mozilla Address Book.  The commonName attribute
# is used for naming entries of this object class, but may not be unique.
#            department $


objectclass ( 1.3.6.1.4.1.13769.9.1 NAME 'mozillaAbPersonAlpha'
In a similar manner to globally overriding the LDAP Address Book schema, it can also be overridden for individual address books.
        SUP top AUXILIARY
        MUST ( cn )
        MAY( c $
              description $
              displayName $
              fax $
              givenName $
              homePhone $
              l $
              mail $
              mobile $
              mozillaCustom1 $
              mozillaCustom2 $
              mozillaCustom3 $
              mozillaCustom4 $
              mozillaHomeCountryName $
              mozillaHomeLocalityName $
              mozillaHomePostalCode $
              mozillaHomeState $
              mozillaHomeStreet $
              mozillaHomeStreet2 $
              mozillaHomeUrl $
              mozillaNickname $
              mozillaSecondEmail $
              mozillaUseHtmlMail $
              mozillaWorkStreet2 $
              mozillaWorkUrl $
              nsAIMid $
              o $
              ou $
              pager $
              postalCode $
              postOfficeBox $
              sn $
              st $
              street $
              telephoneNumber $
              title ) )


----
# Create a LDAP address book in SeaMonkey/Thunderbird.
# Exit SeaMonkey/Thunderbird
# Look in prefs.js for ldap_2.servers.xxx.description - The value should match the name you entered, note the xxx value.
# For the attribute(s) you wish to override, set up new preferences of the form: ldap_2.servers.xxx.attrmap.attribute (where attribute matches one of the global attributes) and set the value to whatever you wish for that address book.
# Save prefs.js and restart SeaMonkey/Thunderbird - you should find that the schema override works only for that particular address book.

Latest revision as of 10:09, 8 March 2010

Resources
MailNews Homepage
Address Book Homepage
Roadmap
Help Wanted
LDAP Address Books
Code Structure
Bug Locations
Related Standards

LDAP Logging

The LDAP logging can be used to view the messages that the Address Book is sending and receiving to/from your LDAP server. We hope that this will aid debugging problems on an LDAP link.

To enable logging set the environment variable "NSPR_LOG_MODULES" to ldap:5 (see links below for how to do this) and start up Address Book, then attempt an LDAP search or autocomplete and the connection/message process will be logged to the console.

For ease of logging, you may wish to also set the NSPR_LOG_FILE to a file location so that you don't need to capture the file output. See the links below on how to set this up.

See these links for more detail:

LDAP Address Book Schema

The address book code specifies default settings for communicating with LDAP servers.

The default settings are specified in a defined schema, currently in an alpha version. Setting up a LDAP server with this schema, and setting up the address book (Thunderbird or SeaMonkey) to talk to that LDAP server will enable all fields to work correctly.

Overriding the default schema for LDAP address books

As of SeaMonkey 1.0 and Thunderbird 1.5 it is possible to override some aspects of the default LDAP schema for address books.

This can either be done for all LDAP address books, or for individual ones.

Globally overriding the default LDAP schema

In preferences (about:config/prefs.js) there are a set of preferences prefixed by "ldap_2.servers.default.attrmap.". For example:

pref("ldap_2.servers.default.attrmap.FirstName", "givenName");
pref("ldap_2.servers.default.attrmap.LastName", "sn,surname");
pref("ldap_2.servers.default.attrmap.DisplayName", "cn,commonname");
pref("ldap_2.servers.default.attrmap.NickName", "mozillaNickname,xmozillanickname");
pref("ldap_2.servers.default.attrmap.PrimaryEmail", "mail");
pref("ldap_2.servers.default.attrmap.Company", "o,company");

By changing these values (comma-separated lists), you are able to override the default mapping for address book attributes.

Taking the Company case, it is by default set to look up the "o" attribute first, if it doesn't find it to be present, it will look up the "company" attribute instead. Note that when searching for items, the address book will only search for the first attribute, i.e. "o" in this case.

So changing "ldap_2.servers.default.attrmap.Company" to "organization,o,company" will cause the address book when searching for Companies, to look at the "organization" attribute, and to prioritise the organization attribute when pulling out values to display.

Note: You can only use each attribute once in the prefs, i.e. you can't set both FirstName and DisplayName to "cn".

Overriding individual LDAP Address Book Schemas

In a similar manner to globally overriding the LDAP Address Book schema, it can also be overridden for individual address books.

  1. Create a LDAP address book in SeaMonkey/Thunderbird.
  2. Exit SeaMonkey/Thunderbird
  3. Look in prefs.js for ldap_2.servers.xxx.description - The value should match the name you entered, note the xxx value.
  4. For the attribute(s) you wish to override, set up new preferences of the form: ldap_2.servers.xxx.attrmap.attribute (where attribute matches one of the global attributes) and set the value to whatever you wish for that address book.
  5. Save prefs.js and restart SeaMonkey/Thunderbird - you should find that the schema override works only for that particular address book.