m(Reverted edit of Draconianintros, changed back to last version by Zyghom)

(10 intermediate revisions by 3 users not shown)

Line 1:

Line 1:

=LDAP and Claws Mail HOWTO based on Kubuntu (7.10)=

=LDAP and Claws Mail HOWTO based on Kubuntu (7.10)=

−

Exaple describes installation and configuration on Ubuntu 7.10 but should be valid for other distributions also.

+

Example describes installation and configuration on Ubuntu 7.10 but should be valid for other distributions also.

It covers:

It covers:

* openldap installation and configuration

* openldap installation and configuration

* claws-mail configuration to use with LDAP

* claws-mail configuration to use with LDAP

==REMOVING OLD INSTALLATION==

==REMOVING OLD INSTALLATION==

−

*In case slapd is already installed, either go to point 4 or reinstall it with commands:

+

*In case slapd is already installed, either go to point [[#CONFIGURATION]] or reinstall it with commands:

:<pre>sudo apt-get purge slapd</pre>

:<pre>sudo apt-get purge slapd</pre>

:<pre>sudo rm -rf /etc/ldap</pre>

:<pre>sudo rm -rf /etc/ldap</pre>

Line 12:

Line 12:

:<pre>sudo rm -rf /var/run/slapd</pre>

:<pre>sudo rm -rf /var/run/slapd</pre>

::<i>(in case your LDAP database is not yet filled)</i>

::<i>(in case your LDAP database is not yet filled)</i>

+

==INSTALLATION==

==INSTALLATION==

*Install slapd:

*Install slapd:

:<pre>sudo apt-get install slapd</pre>

:<pre>sudo apt-get install slapd</pre>

−

:during installation ubuntu usually asks you for ldap admin password - use any - even empty - later we can change it anyway

+

:during installation Ubuntu usually asks you for ldap admin password - use any - even empty - later we can change it anyway

==CONFIGURATION==

==CONFIGURATION==

Line 21:

Line 22:

:<pre>sudo /etc/init.d/slapd stop</pre>

:<pre>sudo /etc/init.d/slapd stop</pre>

*folder for storing data:

*folder for storing data:

−

:make directory where you LDAP will store data - by default it is /var/run/slapd bud I don't recommend it for backup purposes (in case your root partition is to be reinstalled - OS crashed or whatever - then LDAP db is also vanished - my proposal is to use i.e. directory /home/ldap

+

:make directory where your LDAP will store data - by default it is /var/run/slapd but i don't recommend it for backup purposes (in case your root partition is to be reinstalled - OS crashed or whatever - then LDAP db is also vanished - my proposal is to use i.e. directory /home/ldap

::<pre>sudo mkdir /home/ldap</pre>

::<pre>sudo mkdir /home/ldap</pre>

:Because Ubuntu by default runs slapd daemon as user openldap (created automatically during slapd installation), then we must change the ownership of this directory:

:Because Ubuntu by default runs slapd daemon as user openldap (created automatically during slapd installation), then we must change the ownership of this directory:

LDAP and Claws Mail HOWTO based on Kubuntu (7.10)

Example describes installation and configuration on Ubuntu 7.10 but should be valid for other distributions also.
It covers:

openldap installation and configuration

claws-mail configuration to use with LDAP

REMOVING OLD INSTALLATION

In case slapd is already installed, either go to point #CONFIGURATION or reinstall it with commands:

sudo apt-get purge slapd

sudo rm -rf /etc/ldap

(in case your LDAP configuration is not yet in use)

sudo rm -rf /var/run/slapd

(in case your LDAP database is not yet filled)

INSTALLATION

Install slapd:

sudo apt-get install slapd

during installation Ubuntu usually asks you for ldap admin password - use any - even empty - later we can change it anyway

CONFIGURATION

make sure to shut down LDAP server after installation:

sudo /etc/init.d/slapd stop

folder for storing data:

make directory where your LDAP will store data - by default it is /var/run/slapd but i don't recommend it for backup purposes (in case your root partition is to be reinstalled - OS crashed or whatever - then LDAP db is also vanished - my proposal is to use i.e. directory /home/ldap

sudo mkdir /home/ldap

Because Ubuntu by default runs slapd daemon as user openldap (created automatically during slapd installation), then we must change the ownership of this directory:

sudo chown -R openldap:openldap /home/ldap

as an alternative is to change default behaviour of slapd in file /etc/default/slapd the line:

SLAPD_USER="openldap"

should be changed to:

SLAPD_USER=

and in this case slapd runs as root and changing ownership is not needed - in this HOWTO we change the ownership to avoid the mismatch with Ubuntu default settings

ok, claws should be ready to cooperate with LDAP
in addressbook you should see now "Myserver" under LDAP Servers
go to field "Lookup name" and type i.e. homonto and press Find
you should see my name there

AUTOMATIC LDAP CREATION AND CONFIGURATION

If you are brave enough (joke) you can use the script I prepared. It does all steps mentioned above (except reconfiguring claws-mail: this one must do by himself).

Just save all lines to text file, i.e:

gedit (or kedit) /tmp/ldap.sh

and make it executable:

chmod +x /tmp/ldap.sh

Then run the script:

sudo /tmp/ldap.sh

when asked for LDAP password just pres Enter - it is later changed by script to "password" (without quotes)