1
Evolution Data Sources LDAP Backend For GConf
2
=============================================
4
This is a special-purpose backend for GConf which enables default
5
mail accounts, addressbooks and calendars for Evolution to be
6
configured using each user's LDAP entry. By setting each user's mail
7
address, incoming/outgoing mail server addresses and
8
addressbook/calendar addresses in the user's LDAP entry, Evolution
9
will be automatically configured to use these addresses.
14
Once installed, you first need to point the backend at the
15
appropriate LDAP server. Edit /etc/gconf/2/evoldap.conf:
20
<host>ldap.blaa.com</host>
22
<base_dn>ou=people,dc=blaa,dc=com</base_dn>
26
<host> should be pointed at your LDAP server, <port> should usually
27
be left blank (it defaults to 389, the standard port for LDAP) and
28
<base_dn> should point to the location in LDAP where your user entries
31
You then need to store the mail account and addressbook/calendar
32
information in your user's LDAP entries. Using the default template
33
(see below for details on the template) you need to install the LDAP
34
schemas from in your LDAP server evoldap.schema.
36
How you install the custom schema depends entirely on the LDAP
37
server you're using, but with the openldap server, you can just edit
38
/etc/openldap/slapd.conf and add
40
include /etc/openldap/schema/evoldap.schema
42
somewhere near the top of the file. You then install the .schema
43
file in /etc/openldap/schema and restarted slapd.
45
Once the schema is installed, you need to modify the LDAP entries to
46
add the "evolutionMailAccount", "evolutionAddressbookSource",
47
"evolutionCalendarSource" and "evolutionTasksSource" objectClasses and
48
set the cn, mail, evolutionMailSourceURI, evolutionMailTransportURI,
49
evolutionAddressbookURI, evolutionCalendarURI and evolutionTasksURI
50
attributes. You can use any method you like to modify the LDAP entries
51
e.g. a graphical LDAP editor like "gq" or a slapd.replog script with
55
ldapmodify -x -W -D cn=Manager,dc=blaa,dc=com -h ldap.blaa.com <<EOF
56
dn: uid=markmc,ou=people,dc=blaa,dc=com
58
objectClass: evolutionMailAccount
59
objectClass: evolutionAddressbookSource
60
objectClass: evolutionCalendarSource
61
objectClass: evolutionTasksSource
65
evolutionMailSourceURI: imap://markmc@mail.blaa.com/;use_ssl=always
66
evolutionMailTransportURI: smtp://mail.blaa.com
67
evolutionAddressbookSource: FIXME
68
evolutionCalendarSource: FIXME
69
evolutionTasksSource: FIXME
73
You should then be able to verify that the backend is generating the
74
correct value for the /apps/evolution/mail/accounts GConf key:
77
[markmc@blaa ~]$ gconftool-2 --direct --config-source=evoldap:readonly:/etc/gconf/2/evoldap.conf -g /apps/evolution/mail/accounts
78
Resolved address "evoldap:readonly:/gnome/head/INSTALL/etc/gconf/2/evoldap.conf" to a read-only configuration source at position 0
79
None of the resolved addresses are writable; saving configuration settings will not be possible
80
[<?xml version="1.0"?>
81
<account name="markmc@blaa.com" uid="1113478550.9037.0@blaa"
84
<name>Mark McLoughlin</name>
85
<addr-spec>markmc@blaa.com</addr-spec>
90
<source save-passwd="false" keep-on-server="false" auto-check="false" auto-check-timeout="10">
91
<url>imap://markmc@mail.blaa.com/;use_ssl=always</url>
93
<transport save-passwd="false">
94
<url>smtp://mail.blaa.com</url>
98
<auto-cc always="false">
101
<auto-bcc always="false">
104
<pgp encrypt-to-self="false" always-trust="false" always-sign="false" no-imip-sign="false">
107
<smime sign-default="false" encrypt-default="false" encrypt-to-self="false">
115
Finally, in order to make GConf pull from this configuration source,
116
you need to add it to the GConf path file in /etc/gconf/2/path by
117
adding the configuration source address -
118
"evoldap:readonly:/etc/gconf/2/evoldap.conf" - after the user's
119
configuration source - e.g.
122
# Give users a default storage location, ~/.gconf
123
xml:readwrite:$(HOME)/.gconf
125
# Pull default Evolution account from LDAP
126
evoldap:readonly:/etc/gconf/2/evoldap.conf
132
Although this default method of setting things up should work for
133
most people, the configuration file does give you a fair number of
134
options if e.g. you didn't want to (or couldn't) add the custom
135
evolutionMailAccount schema to your LDAP server or if you wanted to
136
have multiple default accounts per user.
138
The default template looks like:
141
<template filter="(&(uid=$(USER))(objectClass=inetOrgPerson)(objectClass=evolutionMailAccount)(objectClass=evolutionAddressbookSource)(objectClass=evolutionCalendarSource)(objectClass=evolutionTasksSource))">
144
<account name="$(LDAP_ATTR_mail)" uid="$(EVOLUTION_UID)" enabled="true">
146
<name>$(LDAP_ATTR_cn)</name>
147
<addr-spec>$(LDAP_ATTR_mail)</addr-spec>
148
<reply-to></reply-to>
149
<organization></organization>
154
The first configurable part is the "filter_str" attribute. This can
155
be any valid LDAP filter which the backend uses to query the LDAP
156
server using the base DN specified earlier. You can test the filter
157
from the command line with:
160
ldapsearch -x -h ldap.blaa.com -b ou=people,dc=blaa,dc=com "(& (uid=markmc)(objectClass=inetOrgPerson)(objectClass=evolutionMailAccount)(objectClass=evolutionAddressbookSource)(objectClass=evolutionCalendarSource)(objectClass=evolutionTasksSource))"
163
(Note that you need to unescape the ampersand and use a valid
164
username when testing the filter)
166
The next configurable part is the variables sprinkled around in the
167
snippet above. There are three types of variables:
169
- $(USER) is the username of the user running evolution
170
- $(EVOLUTION_UID) is a UID generated by the backend in the same
171
format as Evolution uses
172
- $(LDAP_ATTR_*) is the name of an LDAP attribute
174
Each of these variables can be used anywhere in the filter - well,
175
you can't use the $(LDAP_ATTR_*) variables in the filter - or template
178
The value of the /apps/evolution/mail/accounts key is generated by
179
applying this template to each of the LDAP entries returned by
180
searching using the filter string in the specified base DN. The value
181
of the $(LDAP_ATTR_*) variable is determined by looking up the
182
attribute value on then entry to which the template is being applied.
184
Effectively, this means you can don't need to use the custom schema,
185
you can store the account data anywhere in the directory and you can
186
have multiple accounts per user.
191
- In the short term, the configuration file format, schema etc. are
192
all still subject to change
194
- This hasn't yet seen much testing. If you try this out, feedback
195
is much appreciated whether it be good or bad.