How to configure the opensync-plugin-ldap for synchronizing contacts between evolution-2.x and an LDAP server
The very first configuration step: Choose a name for a particular synchronization group:
osynctool --addgroup "sync_ldap_with_evolution"
Which plugins could we use for this synchronization group?
osynctool --listplugins Available plugins: ldap-sync syncml-http-server syncml-http-client syncml-obex-client file-sync evo2-sync
Here we choose the “evo2-sync” and the “ldap-sync” plugin:
osynctool --addmember "sync_ldap_with_evolution" evo2-sync osynctool --addmember "sync_ldap_with_evolution" ldap-sync
Which formats are available for configuring each plugin?
osynctool --listformats
(...)
Format: ldap-evolutionperson
Object Type: contact
Format: ldap-inetorgperson
Object Type: contact
Format: ldap-event
Object Type: event
Format: ldap-todo
Object Type: todo
Format: ldap-note
Object Type: note
(...)
Configure the evo2-sync plugin: For the time being we enable just the object type "contact":
osynctool --configure "sync_ldap_with_evolution" 1
<?xml version="1.0"?>
<config version="1.0">
<Resources>
<Resource>
<Enabled>1</Enabled>
<Formats>
<Format>
<Config>VCARD_EXTENSION=Evolution</Config>
<Name>vcard21</Name>
</Format>
<Format>
<Config>VCARD_EXTENSION=Evolution</Config>
<Name>vcard30</Name>
</Format>
</Formats>
<ObjType>contact</ObjType>
<Url>default</Url>
</Resource>
<Resource>
<Enabled>0</Enabled>
<Formats>
<Format>
<Name>vevent20</Name>
</Format>
</Formats>
<ObjType>event</ObjType>
<Url>default</Url>
</Resource>
<Resource>
<Enabled>0</Enabled>
<Formats>
<Format>
<Name>vtodo20</Name>
</Format>
</Formats>
<ObjType>todo</ObjType>
<Url>default</Url>
</Resource>
<Resource>
<Enabled>0</Enabled>
<Formats>
<Format>
<Name>vjournal</Name>
</Format>
</Formats>
<ObjType>note</ObjType>
<Url>default</Url>
</Resource>
</Resources>
</config>
Configure the “ldap-sync” plugin: The following configuration lets only the objtype “contact” be enabled. It chooses SASL/DIGEST-MD5 as authentication mechanism with the authcid being “ldap_user” and the password “secret”. It connects to a host “host.example.com” on port 389 with the protocol “ldap”.
osynctool --configure "sync_ldap_with_evolution" 2
<?xml version="1.0"?>
<config version="1.0">
<AdvancedOptions>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>binddn</Name>
<Type>string</Type>
<Value>cn=ldap_user,ou=people,dc=example,dc=com</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>authcid</Name>
<Type>string</Type>
<Value>ldap_user</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>password</Name>
<Type>string</Type>
<Value>secret</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>anonymous</Name>
<Type>string</Type>
<Value>0</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>authmech</Name>
<Type>string</Type>
<Value>DIGEST-MD5</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>encryption</Name>
<Type>string</Type>
<Value>0</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>ldap_read</Name>
<Type>string</Type>
<Value>1</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>ldap_write</Name>
<Type>string</Type>
<Value>1</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchbase_contact</Name>
<Type>string</Type>
<Value>ou=addressbook,dc=example,dc=com</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchfilter_contact</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>storebase_contact</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchbase_event</Name>
<Type>string</Type>
<Value>ou=calendar,dc=example,dc=com</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchfilter_event</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>storebase_event</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchbase_todo</Name>
<Type>string</Type>
<Value>ou=todo,dc=example,dc=com</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchfilter_todo</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>storebase_todo</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchbase_note</Name>
<Type>string</Type>
<Value>o=notes,dc=example,dc=com</Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>searchfilter_note</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
<AdvancedOption>
<MaxOccurs>2147483647</MaxOccurs>
<Max>2147483647</Max>
<Name>storebase_note</Name>
<Type>string</Type>
<Value></Value>
</AdvancedOption>
</AdvancedOptions>
<Connection>
<ActiveConnection>Network</ActiveConnection>
<Network>
<Address>host.example.com</Address>
<Port>389</Port>
<Protocol>ldap</Protocol>
</Network>
</Connection>
<Resources>
<Resource>
<Enabled>1</Enabled>
<Formats>
<Format>
<Name>ldap-inetorgperson</Name>
</Format>
</Formats>
<ObjType>contact</ObjType>
</Resource>
<Resource>
<Enabled>1</Enabled>
<Formats>
<Format>
<Name>ldap-event</Name>
</Format>
</Formats>
<ObjType>event</ObjType>
</Resource>
<Resource>
<Enabled>1</Enabled>
<Formats>
<Format>
<Name>ldap-todo</Name>
</Format>
</Formats>
<ObjType>todo</ObjType>
</Resource>
<Resource>
<Enabled>1</Enabled>
<Formats>
<Format>
<Name>ldap-note</Name>
</Format>
</Formats>
<ObjType>note</ObjType>
</Resource>
</Resources>
</config>
Make the configuration become effective:
osynctool --discover "sync_ldap_with_evolution" 1 osynctool --discover "sync_ldap_with_evolution" 2 osynctool --discover "sync_ldap_with_evolution" (...)
Quickly check the “members”:
osynctool --showgroup "sync_ldap_with_evolution" Group: sync_ldap_with_evolution Member 2: ldap-sync Member 1: evo2-sync
And the object types available:
osynctool --showobjtypes "sync_ldap_with_evolution"
Member 1 Objtypes:
Objtype contact: Enabled
conversion config: VCARD_EXTENSION=Evolution
conversion config: VCARD_EXTENSION=Evolution
Member 2 Objtypes:
Objtype contact: Enabled
conversion config:
Objtypes for the group:
contact: Enabled
