OpenLDAP schema for address book prepared for sync with GoogleContacts

I was looking around how to make LDAP schema as much as possible similar to GoogleContacts so I will be able to import my GoogleContacts to my LDAP server. Here is the result.

My contacts in LDAP have following ObjectClasses:

  • top
  • person
  • mozillaOrgPerson
  • organizationalPerson
  • inetOrgPerson
  • evolutionPerson

Except mozillaOrgPerson and evolutionPerson schema all other schemas were there with the OpenLDAP installation. Evolution schema is easy to get. Just install Evolution and you got it. mozillaOrgPerson schema was tricky. I did not found any official source and sources I found differed. So finally I took one and tweaked it based on Thunderbird and Horde documentation so the final
schema and the complete set of attributes fits best. The result:

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

attributetype ( 1.3.6.1.4.1.13769.2.1.2
        NAME ( '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.2.1.5
        NAME 'mozillaPostalAddress2'
        EQUALITY caseIgnoreListMatch
        SUBSTR caseIgnoreListSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )

attributetype ( 1.3.6.1.4.1.13769.2.1.6
        NAME 'mozillaHomePostalAddress2'
        EQUALITY caseIgnoreListMatch
        SUBSTR caseIgnoreListSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )

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 ( '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 ( 'mozillaWorkUrl' )
        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.13
        NAME ( 'mozillaHomeStreet' )
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# MY MODIFICATIONS START
attributetype ( 1.3.6.1.4.1.13769.2.1.14
        NAME ( 'mozillaHomePostOfficeBox' )
        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.15
        NAME ( 'mozillaGender' )
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{10} )

attributetype (  1.3.6.1.4.1.13769.2.1.16
        NAME ( 'mozillaAdditionalNames' )
        SUP name )

attributetype (  1.3.6.1.4.1.13769.2.1.17
        NAME ( 'mozillaNameSuffix' )
        SUP name )

attributetype (  1.3.6.1.4.1.13769.2.1.18
        NAME ( 'mozillaNamePrefix' )
        SUP name )

attributetype ( 1.3.6.1.4.1.13769.2.1.19
        NAME ( 'mozillaInstantMessenger' )
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# MY MODIFICATIONS END

# 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.20
        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 Netscape 6.x and all other LDAP server supporting SYNTAX 2.16.840.1.113730.3.7.1
# attributeTypes ( 2.16.840.1.113730.3.1.2013
#       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 ( '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 ( '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 ( '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 ( '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 'mozillaOrgPerson'
        SUP top
        AUXILIARY
        MAY (
        mozillaNickname $
        mozillaUseHtmlMail $
        mozillaSecondEmail $
        mozillaPostalAddress2 $
        mozillaHomePostalAddress2 $
        mozillaHomeLocalityName $
        mozillaHomeState $
        mozillaHomePostalCode $
        mozillaHomeCountryName $
        mozillaHomeFriendlyCountryName $
        mozillaHomeUrl $
        mozillaWorkUrl $
        mozillaHomeStreet $
        mozillaHomePostOfficeBox $
        mozillaGender $
        mozillaAdditionalNames $
        mozillaNameSuffix $
        mozillaNamePrefix $
        mozillaInstantMessenger $
        mozillaCustom1 $
        mozillaCustom2 $
        mozillaCustom3 $
        mozillaCustom4 $
        nsAIMid $
        c $
        co ) )

Then test and convert and add the schema to LDAP server as described in previous post.

Leave a Reply

Your email address will not be published. Required fields are marked *