Inhaltsverzeichnis

Installation IMAP daemon courier

Vorbereitung

Das Dokument bezieht sich auf die Installation des IMAP daemons courier in Version 4.1.x.
Als Erstes lädt man sich die Sourcen der benötigten Komponenten herunter:

Nach dem Download werden alle Archive in einem temporären Verzeichnis ausgepackt.

Berkeley DB kompilieren

cd db-4.4.x
cd build_unix
../dist/configure --with-gnu-ld
make
make install
cd ..

Courier authentication library kompilieren

cd courier-authlib-x.xx

CPPFLAGS=-I/usr/local/BerkeleyDB.4.4/include LDFLAGS=-L/usr/local/BerkeleyDB.4.4/lib \
./configure --with-gnu-ld --without-authpgsql --without-authmysql --with-authpam --with-authpwd --with-authshadow

make
make check
make install-configure
cd ..

Natürlich kann man das Ganze auch mit PostgreSQL-Anbindung und Verschlüsselung bauen. Das würde dann ungefähr so aussehen:

cd courier-authlib-x.xx

CPPFLAGS="-I/usr/local/BerkeleyDB.4.5/include -I/usr/local/pgsql/include -I/opt/apache/include" \
LDFLAGS="-L/usr/local/BerkeleyDB.4.5/lib -L/usr/local/pgsql/lib -ldl -L/opt/apache/lib" \
./configure --with-gnu-ld --without-authmysql --with-pgsql-libs=/usr/local/pgsql/lib --with-pgsql-includes=/usr/local/pgsql/include --with-db=db \
--with-authpgsqlrc=/usr/local/etc/authlib/authpgsqlrc

make
make check
make install-configure
cd ..

Im obigen Beispiel wurde openSSL nach /opt/apache installiert. Die Bibliotheken nach lib/ und die Headerfiles nach include/
Außerdem wurde /opt/apache/lib in /etc/ld.so.conf eingetragen und ldconfig aufgerufen, um LD_LIBRARY_PATH auf den neuesten Stand zu bringen.

Courier IMAPd kompilieren

su - <normal user>
cd courier-imap-4.1.x
CPPFLAGS=-I/usr/local/BerkeleyDB.4.4/include LDFLAGS=-L/usr/local/BerkeleyDB.4.4/lib ./configure --with-gnu-ld --with-db=db
make
make check (export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/BerkeleyDB.4.4/lib)
exit (Rest als root)
cd courier-imap-4.1.x
make install-strip
make install-configure
cd /usr/lib
for i in $(ls /usr/local/BerkeleyDB.4.4/lib/*);do ln -s $i $(basename $i);done

Wenn man die Kommunikation verschlüsseln möchte, dann muß man folgendermaßen vorgehen:

su - <normal user>
cd courier-imap-4.1.x
CPPFLAGS="-I/usr/local/BerkeleyDB.4.5/include -I/usr/local/pgsql/include -I/opt/apache/include" \
LDFLAGS="-L/usr/local/BerkeleyDB.4.5/lib -L/usr/local/pgsql/lib -L/opt/apache/lib -ldl -lssl -lcrypto" \
./configure --with-gnu-ld --with-db=db
make install-strip
make install-configure
cd /usr/lib
for i in $(ls /usr/local/BerkeleyDB.4.4/lib/*);do ln -s $i $(basename $i);done

Wenn man sich das Linken der BerkeleyDB-Libraries schenken möchte, sollte man /usr/local/BerkeleyDB.4.4/lib in den LD_LIBRARY_PATH aufnehmen 3)

Umstellung der mbox-Dateien auf Maildir (exim4)

Als normaler User, dessen Mailbox umgestellt werden soll, führt man folgende Befehle aus:

cd $HOME
mkdir -p Maildir/new Maildir/cur Maildir/tmp
chmod -R 700 Maildir

Als root fügt man in die Datei /etc/exim4/update-exim4.conf.conf folgende Zeile ein:

dc_localdelivery='maildir_home'

und restartet den Maildaemon. Bereits erhaltene Mails, welche unter /var/spool/mail/<username> gespeichert sind werden als der jeweilige User mit

mb2md -s /var/spool/mail/<username> -d Maildir/

in das neue Format konvertiert.

1)
Berkeley DB 4.5.xx funktioniert auch
2)
ist aber rein optional
3)
analog /opt/apache/lib