Omldapsync HowTo - Four

From Scalix Wiki
Jump to: navigation, search

Using Additional LDAP Attributes not Contained in the Mapping Table

You're not limited to only importing the default LDAP attributes and special Scalix attributes from LDAP into Scalix; you can import additional LDAP attributes into your Scalix directory. The list of attributes being imported from LDAP can be found in the EX_ATTR and IM_MV_ATTR definitions of the agreement's sync.cfg file. Following the example we've set up in this document, /var/opt/scalix/??/s/ldapsync/13fubar/sync.cfg contains the following lines (this is from an agreement with a Sun ONE Directory Server; in an agreement with an OpenLDAP server the nsUniqueID attribute would be replaced with entryUUID):

EX_ATTR=scalixHideUserEntry scalixMailboxClass scalixLimitMailboxSize scalixLimitOutboundMail scalixLimitInboundMail scalixLimitNotifyUser scalixScalixObject scalixMailnode scalixServerLanguage scalixAdministrator scalixMailboxAdministrator scalixEmailAddress member dn uid objectClass displayName sn givenname initials mail nsUniqueID cn facsimileTelephoneNumber homephone street st telephoneNumber title c company departmentNumber description l mobile pager physicalDeliveryOfficeName postalCode

IM_MV_ATTR=objectClass INTERNET-ADDR omMemberForeignAddr

Let's say you wanted to synchronize LDAP's employeenumber attribute with Scalix. The first thing you do is look in the sync.cfg file for the agreement and see that it's not already being synchronized; that is, make sure it isn't listed in the EX_ATTR or IM_MV_ATTR definitions. If you see your desired attribute in one of the definitions, look in the mapping table portion of the agreement to find out what Scalix attribute corresponds to your desired LDAP attrbibute. For more information, see "Understanding the Mapping Table" section of this document.

If you don't see your desired LDAP attribute in the EX_ATTR or IM_MV_ATTR definitions, add it. Use EX_ATTR for regular attributes and IM_MV_ATTR for multi-valued attributes.

The second thing you need to do is figure out which Scalix attribute you want to map to the LDAP attribute. The omshowatt command is very useful for this purpose.

# omshowatt | more
<...>
NAME-TITLE                                10  Personal Title
HOME-PHONE                     KMSV       32  Home Telephone Number
A                              X          16  X.400 Administration Domain
EMPL-ID                        K          30  Employee ID
LDAP-OBJECT-CLASS              V          40  LDAP objectClass

The first column is the name of the Scalix attribute.

The second column holds flags. The man page for omshowatt will give you good information about these but for now it is sufficient to know that a "V" means it is a multi-valued attribute. If you are importing a multi-valued LDAP attribute, then you must import it into a Scalix attribute with a "V" in the second column of omshowatt output.

The third column is the length in octets.

The fourth column is a "friendlier" localized name.

The EMPL-ID attribute seems like a good one for our purposes. We'll map the LDAP employeeNumber attribute to the Scalix EMPL-ID attribute by adding an entry into the primary mapping table section of the sync.cfg file for this agreement. For example:

employeeNumber|EMPL-ID|*,1,30|*

The above entry means we will import the first thirty characters of the LDAP employeeNumber and store it in the Scalix EMPL-ID attribute.

Fixing omldapsync After Errors

Using omsyncwrap