Koozali.org: home of the SME Server

LDAP (Bug?) und Thunderbird

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
LDAP (Bug?) und Thunderbird
« on: February 14, 2009, 11:39:33 PM »
Hallo,

ich verusche gerade den LDAP für das Thunderbirdadressbuch anzupassen und bin bisher zu dem folgenden Ergebnis gekommen:
--------------------------------------------------------------------------------------------------------------

Adressbuch anlegen
==================

Zu erst wird über phpldapadmin ein Eintrag einer "Organisational Unit" erstellt.
Dieser Eintrag erhält den Namen für unser Adressbuch, wie z.B. "Adressbuch".



Verbinden mit Thunderbird
=========================

Über Thunderbird -> Adressbuch -> Neu->LDAP-Verzeichnis geben wir die Daten zu der
eben erstellten Oranisationseinheit wie folgt an:

Name:      [Angezeigte Name]      (In diesem Beispiel Adressbuch)
Server-Adresse:   [IP des Servers]
Basis-DN:   [OU=OU,DC=DC,DC=DC]      (In diesem Beispiel ou=Adressbuch,dc=meinserver,dc=local)
Port-Nr.:   389
Bind-DN:   [Hier kann ein Benutzer angegeben werden] (In diesem Beispiel leer)



Oder/Und über Thunderbird ->Extras->Konten->Verfassen & Adressieren:

1. "Einen anderen LDAP-Verzeichnisserver verwenden:" - auswählen
2. "Bearbeiten" anklicken
3. "Hinzufügen" anklicken
4. und die gleichen Einstellungen wie oben vornehmen.



OpenLdap - Adressbuch für Thunderbird anpassen
==============================================


Damit die Suche über die Konsole funktioniert muß noch der LDAP-Client installiert werden:

yum install openldap-clients
signal-event post-upgrade; signal-event reboot


Damit der OpenLDAP-Server auch mit allen Einträgen, welche er für Outlook und Thunderbird braucht,
umgehen kann, muss man ihm zwei weitere Schema-Dateien zur Verfügung stellen. Es sind folgenden Dateien nötig:

extension.schema
mozilla_btw.schema

Diese 2 Dateien müssen in das Verzeichnis /etc/openldap/schema kopiert werden.


Außerdem müssen sie in der Datei /etc/openldap/slapd.conf dem LDAP-Server, durch Eintrag der folgenden
Zeilen bekannt gemacht werden:

include         /etc/openldap/schema/mozilla_btw.schema
include         /etc/openldap/schema/extension.schema


Damit die Änderungen dauerhaft und auch nach einem Reboot erhalten bleiben muß das Template für Openldap
noch wie folgt angepasst werden:

cp -R /etc/e-smith/templates/etc/openldap /etc/e-smith/templates-custom/etc/
cd /etc/e-smith/templates-custom/etc/openldap/slapd.conf


Die Datei 10schema wird dann analog zur Datei slapd.conf um die 2 folgenden Dateien ergänzt:

include         /etc/openldap/schema/mozilla_btw.schema
include         /etc/openldap/schema/extension.schema

Der Befehl zum öffnen mittels Pico lautet
pico 10schema


Normalerweise würde an dieser Stelle nun der folgende Befehl kommen, aber leider scheint hier ein Bug
im PRogramm zu sein:

expand-template /etc/openldap




Adressbuch über LDIF Datei in den LDAP einlesen:
================================================

Um ein Adressbuch in den LDAP einzulesen benötigt man eine LDIF-Datei.

Als Beispiel erstellen wir mit dem Notepad eine Datei mit dem namen user.ldif:

Zur Demonstartion befüllen wir diese mit dem folgenden Inhalt:
dn: cn=Nachname Vorname,[ou=MEINEOU,dc=MEINEDC,dc=MEINEDC]
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
givenName: Vorname
sn: Nachname
cn: Nachname Vorname
mozillaNickname: Spitzname
mail: Vorname.Nachname@firma.com
mozillaSecondEmail: Vorname.Nachname@rivat.de
telephoneNumber: 1111111
homePhone: 2222222
fax: 3333333
mobile: 44444444
mozillaHomeStreet: strasse priv1
mozillaHomeStreet2: strasse priv 2
mozillaHomeFriendlyCountryName: stadt
mozillaHomeLocalityName: Stadt priv
mozillaHomeState: Bundesland priv
mozillaHomePostalCode: PLZ priv
mozillaHomeCountryName: Land priv
street: Strasse1 gesch
l:: V2Vpw59lbmhvcm4=
st: Bundesland gesch
postalCode: PLZ gesch
c: Land gesch
title: Titel
ou: Abteilung
o: Firma
pager: Pager
nsAIMid: MSN
mozillaWorkUrl: www.hallo.de
mozillaHomeUrl: www.hallo.de
mozillaCustom1: Zusatz 1
mozillaCustom2: Zusatz 2
mozillaCustom3: Zusatz 3
mozillaCustom4: Zusatz 4


Der Import der Datei kann einfach über phpmyldapadmin durch einen Klick auf
import/durchsuchen/ Dateiauswählen und "Proceed>>" gestartet werden.

Duch einen Klick auf "Aktualisieren" wird der Eintrag dann sichtbar.

Hinweis: Mehrere Adressen werden einfach untereinander in der LDIF-Datei eingetragen.



Export und Import mit Thunderbird
=================================
Adressen können aus dem Thunderbird in eine LDIF-Datei exportiert werden. Am folgenden
Beispiel ist zu sehen, welche Teile nach dem Export pro Adresseintrag abgeändert werden müssen.

dn: cn=Vorname Nachname,ou=[Meine OU],dc=[Mein DC],dc=[Mein DC]
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha<---------- Zeile löschen
givenName: Vorname
sn: Nachname
cn: Nachname Vorname
mozillaNickname: Spitzname
mail: Email1
mozillaSecondEmail: email2
modifytimestamp: xx<------------------------ Zeile löschen
telephoneNumber: Tel. gesch.
homePhone: Tel. priv.
fax: Fax
mobile: Mobil
homeStreet: Strasse1 priv<----------------- in mozillaHomeStreet: ändern
mozillaHomeLocalityName:: stadt <---------- Stadt muß verschlüsselt angegeben werden
mozillaHomeState: priv. Bundesland
mozillaHomePostalCode: PLZ priv.
mozillaHomeCountryName: priv. Land
street: Strasse gesch.
l:: Stadt<--------------------------------- Stadt muß verschlüsselt angegeben werden
st: Bundesland gesch.
postalCode: PLZ  gesch.
c: Land gesch.
title: Titel
department: Abteilung<----------------------in ou: ändern
company: Firma<-----------------------------in o ändern
mozillaWorkUrl: Internet gesch.
mozillaHomeUrl: Internet priv.
mozillaCustom1: Zusatz 1
mozillaCustom2: Zusatz 2
mozillaCustom3: Zusatz 3
mozillaCustom4: Zusatz 4


Eingabe mit myldapadmin:
========================
Zur Eingabe von Daten in das Adressbuch über myldapadmin empfiehlt es sich die neuen
Einträge über "Address Book Entry (mozillaOrgPerson)" anzulegen.



Programme für die Eingabe:
==========================
Kmail und Evolution können nicht nur auf LDAP zugreifen, sondern sogar Einträge hinzufügen.

----------------------------------------------------------------------------------------------------------

Das Ganze funktioniert ist aber noch nicht so Optimal. Vlt. findet sich ja eine gemeinsame Lösung die wir gleich in den
SME mit einbauen können ;).

Meine Fragen hierzu sind nun:
1. Wie expandiere ich das Template für Openldap, oder ist das ein Bug?
2. Hat jemand ein besseres Schema für das Adressbuch von Thunderbird?
3. Wo finde ich die OID's die das Adressbuch von Thunderbird verwendet?

Schmal vorab vielen Dank für euere Hilfe!

Gruß

Lance
« Last Edit: February 15, 2009, 05:39:10 AM by lancelott2 »
---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
Re: LDAP Bug und Thunderbird
« Reply #1 on: February 14, 2009, 11:42:29 PM »
Nachtrag:

Die Datei mozilla_btw.schema enthält:
---------------------------------------------------------------------------------------------------

# created mozillaAbPersonObsolete schema
# from mozillaOrgPerson schema v.0.6
# for OpenLDAP Directory servers
#
# Changes from v.0.6
#
# - Add additional attritute names to match those currently exported
#   from mozilla, except for 'mozilla_AimScreenName' which is invalid.
#   I have found that mozilla does not find them otherwise.
# - Set both versions of 'nsAIMid' to use the mozilla OID space.
# - Make 'inetOrgPerson' the SUP for 'mozillaAbPersonObsolete'.

# req. core
# req. cosine
# req. inetorgperson

# attribute defs

attributetype ( 1.3.6.1.4.1.13769.2.1.1
   NAME ( 'xmozillanickname' 'mozillaNickname' )
   SUP name )

attributetype ( 1.3.6.1.4.1.13769.2.1.2
   NAME ( 'xmozillausehtmlmail' 'mozillaUseHtmlMail' )
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
   SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.13769.2.1.3
   NAME 'mozillaSecondEmail'
   EQUALITY caseIgnoreIA5Match
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

attributetype ( 1.3.6.1.4.1.13769.2.1.4
   NAME 'mozillaHomeLocalityName'
   EQUALITY caseIgnoreMatch
   SUBSTR caseIgnoreSubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 1.3.6.1.4.1.13769.3.1 NAME 'mozillaHomeStreet'
    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'
    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.2.1.7
   NAME ( 'mozillaHomeState' ) SUP name )

attributetype ( 1.3.6.1.4.1.13769.2.1.8
   NAME 'mozillaHomePostalCode'
   EQUALITY caseIgnoreMatch
   SUBSTR caseIgnoreSubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )

attributetype ( 1.3.6.1.4.1.13769.2.1.9
   NAME ( 'mozillaHomeCountryName' )
   SUP name SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.13769.2.1.10
   NAME ( 'mozillaHomeFriendlyCountryName' )
   EQUALITY caseIgnoreMatch
   SUBSTR caseIgnoreSubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.13769.2.1.11
   NAME ( 'homeurl' 'mozillaHomeUrl' )
   EQUALITY caseIgnoreIA5Match
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

attributetype ( 1.3.6.1.4.1.13769.2.1.12
   NAME ( 'workurl' 'mozillaWorkUrl' )
   EQUALITY caseIgnoreIA5Match
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

# un-comment for all LDAP server NOT supporting SYNTAX 2.16.840.1.113730.3.7.1
attributetype ( 1.3.6.1.4.1.13769.2.1.13
   NAME ( 'nsAIMid' )
   DESC 'AOL Instant Messenger (AIM) Identity'
   EQUALITY telephoneNumberMatch
   SUBSTR telephoneNumberSubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )

# un-comment for ... LDAP server supporting SYNTAX 2.16.840.1.113730.3.7.1
#attributetype ( 1.3.6.1.4.1.13769.2.1.13
#   NAME ( 'nsAIMid' )
#   DESC 'AOL Instant Messenger (AIM) Identity'
#   SYNTAX 2.16.840.1.113730.3.7.1 )

attributetype ( 1.3.6.1.4.1.13769.2.1.96
   NAME ( 'custom1' 'mozillaCustom1' )
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
   SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.13769.2.1.97
   NAME ( 'custom2' 'mozillaCustom2' )
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
   SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.13769.2.1.98
   NAME ( 'custom3' 'mozillaCustom3' )
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
   SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.13769.2.1.99
   NAME ( 'custom4' 'mozillaCustom4' )
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
   SINGLE-VALUE )
 

# objectClass defs

objectclass ( 1.3.6.1.4.1.13769.2.2.1
   NAME 'mozillaAbPersonObsolete'
   SUP inetOrgPerson
   STRUCTURAL
   MAY (
   mozillaNickname $
   mozillaUseHtmlMail $
   mozillaSecondEmail $
   mozillaHomeLocalityName $
   mozillaHomeState $
   mozillaHomeStreet $
    mozillaHomeStreet2 $
   mozillaHomePostalCode $
   mozillaHomeCountryName $
   mozillaHomeFriendlyCountryName $
   mozillaHomeUrl $
   mozillaWorkUrl $
   mozillaCustom1 $
   mozillaCustom2 $
   mozillaCustom3 $
   mozillaCustom4 $
   nsAIMid $
   c $
   co ) )

---------------------------------------------------------------------------------------------------------------

Die Datei extension.schema enthält:
---------------------------------------------------------------------------------------------------------------

attributetype ( 1.3.6.1.4.1.4203.666.100.121
        NAME ( 'rdn' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.122
        NAME ( 'otherFacsimiletelephoneNumber' )
        SUP telephoneNumber )

attributetype ( 1.3.6.1.4.1.4203.666.100.123
        NAME ( 'IPPhone' )
        SUP telephoneNumber )

# This attribute handles MS/Outlook and Netscape Communicator

#attributetype ( 1.3.6.1.4.1.4203.666.100.124
 #       NAME ( 'URL' 'homeUrl' )
 #       SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.125
        NAME ( 'comment' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.126
        NAME ( 'conferenceInformation' )
        SUP name )

attributetype ( 1.3.6.1.4.1.4203.666.100.127
        NAME ( 'reports' )
        SUP manager )

objectclass     ( 1.3.6.1.4.1.4203.666.100.1
    NAME 'officePerson'
        DESC 'Office employee or computer user'
    SUP inetOrgPerson
    STRUCTURAL
        MAY  ( c $
               rdn $
               otherFacsimiletelephoneNumber $
               IPPhone $
               comment $
               reports $
               conferenceInformation )
    )
--------------------------------------------------------------------------------------------------------------

Grüße

Lance
---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------