MailNews:LDAP Address Books: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created inital (WIP) version of the Mozilla LDAP Schema)
 
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==== LDAP Address Book Schema - Alpha Version ====
{{Template:Mailnews Address Book Resources}}


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).
== LDAP Logging ==


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


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].
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.


Any Updates to the schema will be documented in the header.
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:


# Mozilla: @VERSION@
* [[Mailnews:Logging]]
#
# 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
== LDAP Address Book Schema ==
#  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
The address book code specifies default settings for communicating with LDAP servers.


attributetype ( 1.3.6.1.4.1.13769.4.1 NAME 'mozillaCustom1'
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.
        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'
== Overriding the default schema for LDAP address books ==
        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'
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{128} SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.2 NAME 'mozillaHomeStreet2'
This can either be done for all LDAP address books, or for individual ones.
        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'
=== Globally overriding the default LDAP schema ===
        SUP name SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.4 NAME 'mozillaHomeState'
In preferences (about:config/prefs.js) there are a set of preferences prefixed by "ldap_2.servers.default.attrmap.". For example:
        SUP name SINGLE-VALUE )


attributetype ( 1.3.6.1.4.1.13769.3.5 NAME 'mozillaHomePostalCode'
<pre>
        EQUALITY caseIgnoreMatch
pref("ldap_2.servers.default.attrmap.FirstName", "givenName");
        SUBSTR caseIgnoreSubstringsMatch
pref("ldap_2.servers.default.attrmap.LastName", "sn,surname");
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} SINGLE-VALUE )
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");
</pre>


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


attributetype ( 1.3.6.1.4.1.13769.3.7 NAME 'mozillaHomeUrl'
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.
        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'
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.
        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'
Note: You can only use each attribute once in the prefs, i.e. you can't set both FirstName and DisplayName to "cn".
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )
# 1.3.6.1.4.1.13769.2.x - Mozilla AB 'Contact' tab


attributetype ( 1.3.6.1.4.1.13769.2.1
=== Overriding individual LDAP Address Book Schemas ===
        NAME ( 'mozillaNickname' 'xmozillanickname' )
        SUP name )


attributetype ( 1.3.6.1.4.1.13769.2.2
In a similar manner to globally overriding the LDAP Address Book schema, it can also be overridden for individual address books.
        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
# Create a LDAP address book in SeaMonkey/Thunderbird.
        NAME ( 'mozillaUseHtmlMail' 'xmozillausehtmlmail' )
# Exit SeaMonkey/Thunderbird
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
# 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.
# AOL Instant Messenger (AIM) Identity
# Save prefs.js and restart SeaMonkey/Thunderbird - you should find that the schema override works only for that particular address book.
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
# 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'
        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 ) )
 
----

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.