GAL Attribute Mapping

Revision as of 22:05, 3 May 2007 by CAH (talk | contribs) (zimbraGalLdapAttrMap information from forums)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The value of zimbraGalLdapAttrMap controls which gal attributes get requested and how they get converted to our contact model. The default map can be obtained via zmprov:

Code:

/opt/zimbra/bin/zmprov gacf|grep zimbraGalLdapAttr
zimbraGalLdapAttrMap: co=workCountry
zimbraGalLdapAttrMap: company=company
zimbraGalLdapAttrMap: description=notes
zimbraGalLdapAttrMap: displayName,cn=fullName
zimbraGalLdapAttrMap: givenName,gn=firstName
zimbraGalLdapAttrMap: initials=initials
zimbraGalLdapAttrMap: l=workCity
zimbraGalLdapAttrMap: objectClass=objectClass
zimbraGalLdapAttrMap: ou=department
zimbraGalLdapAttrMap: physicalDeliveryOfficeName=office
zimbraGalLdapAttrMap: postalCode=workPostalCode
zimbraGalLdapAttrMap: sn=lastName
zimbraGalLdapAttrMap: st=workState
zimbraGalLdapAttrMap: street,streetAddress=workStreet
zimbraGalLdapAttrMap: telephoneNumber=workPhone
zimbraGalLdapAttrMap: title=jobTitle
zimbraGalLdapAttrMap: whenChanged,modifyTimeStamp=modifyTimeStamp
zimbraGalLdapAttrMap: whenCreated,createTimeStamp=createTimeStamp
zimbraGalLdapAttrMap: zimbraCalResLocationDisplayName=zimbraCalResLocationDisplayName
zimbraGalLdapAttrMap: zimbraCalResType=zimbraCalResType
zimbraGalLdapAttrMap: zimbraId=zimbraId
zimbraGalLdapAttrMap: zimbraMailDeliveryAddress,zimbraMailAlias,mail=email,email2,email3,email4,email5,email6
zimbraGalLdapAttrMap: zimbraMailForwardingAddress=zimbraMailForwardingAddress

The map is basically a set of rules that looks like:

a,b=c,d


Where the attrs on the left-hand come from LDAP and get mapped to the values on the right-hand side, which correspond to our contact model.

For example, the rule:

zimbraGalLdapAttrMap: street,streetAddress=workStreet

says if the LDAP result contains "street", map it to workStreet. If it doesn't contain "street" , then see if it contains "streetAddress" and map that to workStreet.

If there are multiple values for a given attribute on the left-hand side and multiple listed on the right-hand side, then it will map the values on the left to the values on the right, sequential. i.e if you have:

a=b,c

And the LDAP result contains two values for a (lets assume "a1", and "a2"), then "b" will get set to "a1" , and "c" will get set to "a2".

You can add/remove mappings using zmprov:

/opt/zimbra/bin/zmprov                            
prov> mcf
usage:  modifyConfig(mcf) attr1 value1 [attr2 value2...]
prov> mcf +zimbraGalLdapAttrMap x=y
prov> mcf -zimbraGalLdapAttrMap x=y
prov>

The syntax "+zimbraGalLdapAttrMap" means to add an additional zimbraGalLdapAttrMap attribute to the config, while "-zimbraGalLdapAttrMap" means to remove an existing setting.

Our contact model contains (roughly, some of these might not be displayed in the client) the following set of fields, which I grabbed from Contact.java in the ZimbraServer source:

   public static final String A_birthday = "birthday";
   public static final String A_callbackPhone = "callbackPhone";
   public static final String A_carPhone = "carPhone";
   public static final String A_company = "company";
   public static final String A_companyPhone = "companyPhone";
   public static final String A_department = "department";
   public static final String A_dlist = "dlist";
   public static final String A_email = "email";
   public static final String A_email2 = "email2";
   public static final String A_email3 = "email3";
   public static final String A_fileAs = "fileAs";
   public static final String A_firstName = "firstName";
   public static final String A_fullName = "fullName";
   public static final String A_homeCity = "homeCity";
   public static final String A_homeCountry = "homeCountry";
   public static final String A_homeFax = "homeFax";
   public static final String A_homePhone = "homePhone";
   public static final String A_homePhone2 = "homePhone2";
   public static final String A_homePostalCode = "homePostalCode";
   public static final String A_homeState = "homeState";
   public static final String A_homeStreet = "homeStreet";
   public static final String A_homeURL = "homeURL";
   public static final String A_image = "image";
   public static final String A_initials = "initials";
   public static final String A_jobTitle = "jobTitle";
   public static final String A_lastName = "lastName";
   public static final String A_middleName = "middleName";
   public static final String A_mobilePhone = "mobilePhone";
   public static final String A_namePrefix = "namePrefix";
   public static final String A_nameSuffix = "nameSuffix";
   public static final String A_nickname = "nickname";
   public static final String A_notes = "notes";
   public static final String A_office = "office";
   public static final String A_otherCity = "otherCity";
   public static final String A_otherCountry = "otherCountry";
   public static final String A_otherFax = "otherFax";
   public static final String A_otherPhone = "otherPhone";
   public static final String A_otherPostalCode = "otherPostalCode";
   public static final String A_otherState = "otherState";
   public static final String A_otherStreet = "otherStreet";
   public static final String A_otherURL = "otherURL";
   public static final String A_pager = "pager";
   public static final String A_workCity = "workCity";
   public static final String A_workCountry = "workCountry";
   public static final String A_workFax = "workFax";
   public static final String A_workPhone = "workPhone";
   public static final String A_workPhone2 = "workPhone2";
   public static final String A_workPostalCode = "workPostalCode";
   public static final String A_workState = "workState";
   public static final String A_workStreet = "workStreet";
   public static final String A_workURL = "workURL";
   public static final String A_type = "type";

So you'll want to look the AD attributes that you have set as the ones on the left-hand side of the rule, and then the above contact fields as the ones to map them to on the right hand.

Jump to: navigation, search