Installing qmail-ldap on Ubuntu Server (64bit)
Jimmy Brake Jul 04, 2008

 

This document is borrowing heavily from http://www.lifewithqmail.org/ldap/#Installation and http://www.qmail-ldap.org/wiki/INSTALL I am just adding specific directions for Ubuntu Server 6.10 (64bit) and consolidating.

 

First you should follow my other tutorial on installing tinydns, this document assumes you are right where we left off.

 

Install needed packages.

 

apt-get install slapd libldap2-dev libssl-dev openssl sharutils unzip clamav-daemon maildrop perl-suid

 

(don't forget the password for slapd) -- this also install exim4 ... so at the some point we need to remove it

 

run this command:

 

newaliases

 

move back to your /usr/src dir

 

cd /usr/src

 

get qmail/unzip it:

 

wget http://cr.yp.to/software/qmail-1.03.tar.gz

tar xfvz qmail-1.03.tar.gz

 

get the qmail-ldap patch from: http://www.qmail-ldap.org/wiki/Releases move into the qmail dir

unzip it and apply the patch ...

 

gunzip qmail-ldap-1.03-20060201.patch.gz

cd qmail-1.03

patch -p1 < ../qmail-ldap-1.03-20060201.patch

 

At this point you should be good to follow directions from step 5 at:

Open the makefile in ..

 

vim Makefile --- read it

we add a line like this: LDAPFLAGS=-DQLDAP_CLUSTER -DDASH_EXT -DALTQUEUE -DBIGBROTHER -DQUOTATRASH

 

and uncomment this line

 

SHADOWLIBS=-lcrypt

 

We then edit qmail-ldap.h -- you may not need to do this ...

and change

#define LDAP_UID "uid"

to

#define LDAP_UID "mail"

 

Add all the users ...

groupadd nofiles
useradd -g nofiles -d /var/qmail/alias alias
useradd -g nofiles -d /var/qmail qmaild
useradd -g nofiles -d /var/qmail qmaill
useradd -g nofiles -d /var/qmail qmailp
groupadd qmail
groupadd vmail
groupadd qscand
useradd -g qmail -d /var/qmail qmailq
useradd -g qmail -d /var/qmail qmailr
useradd -g qmail -d /var/qmail qmails
echo "vmail:x:600:600::/var/qmail/maildirs/:/bin/true" >> /etc/passwd

... then

make;make setup check

then ...

cd /service
ln -s /var/qmail/boot/qmail-smtpd .
ln -s /var/qmail/boot/qmail-qmqpd .
ln -s /var/qmail/boot/qmail .

then... umm if your using sendmail ... maybe not a good idea to do the nest step..

rm /usr/lib/sendmail
rm /usr/sbin/sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

 

for some reason .. exim4 was running

/etc/init.d/exim4 stop

configure the qmail-ldap ...

cd /var/qmail

mkdir maildirs

 

cd control

 

... here i have a script that I run and pulls this servers config from the db ....

 

I don't however have env's scripted

 

NOTE: I have a line about qmail-scanner .... that may not apply to your installation ... so don't use it unless you plan on using qmail scanner ... using the default install instructions from qmail-scanner instructions worked fine for me

 

cd /var/qmail/boot/

echo "1" > qmail-smtpd/env/BLOCKRELAYPROBE
echo "300" > qmail-smtpd/env/CONCURRENCYINCOMING
echo "256" > qmail-smtpd/env/LOGLEVEL
echo "50" > qmail-smtpd/env/MAXRCPTCOUNT
echo "500" > qmail-smtpd/env/MAXSMTPD
echo "1" > qmail-smtpd/env/NOPBS
echo "1" > qmail-smtpd/env/RBL
echo "1" > qmail-smtpd/env/RCPTCHECK
echo "1" > qmail-smtpd/env/RETURNMXCHECK
echo "0" > qmail-smtpd/env/SENDERCHECK
echo "1" > qmail-smtpd/env/SMTPAUTH

echo "/var/qmail/bin/qmail-scanner-queue.pl" > qmail-smtpd/env/QMAILQUEUE

svc -h /service/*

 

installing qmail-scanner ... if you need it ...

find it unzip it then

cd into the dir the ./configure --archive yes

 

 

for mailing list support ...

find(use Google) .. ezmlm and ezmlm-idx tar files ... then unzip and follow install in the idx make sure to apply the patchs ..

 

cd /usr/src/

tar xfz ezmlm-0.53.tar.gz

tar xfz ezmlm-idx-0.40.tar.gz

mv ezmlm-idx-0.40/* ezmlm-0.53/.

cd ezmlm-0.53

patch < idx.patch

patch -p1 < /usr/local/djb/patches/ezmlm-idx-0.53.400.unified_41.patch

sed 's/\/usr\/bin/\/usr\/local\/bin'

make clean

make; make setup

 

... make setup did not work for me .. so i moved the new binary files manually

 

make a file foo2

ezmlm-accept
ezmlm-archive
ezmlm-check
ezmlm-clean
ezmlm-cron
ezmlm-gate
ezmlm-get
ezmlm-glconf
ezmlmglrc
ezmlm-idx
ezmlm-issubn
ezmlm-limit
ezmlm-list
ezmlm-make
ezmlm-manage
ezmlm-mktab
ezmlm-moderate
ezmlmrc
ezmlm-reject
ezmlm-request
ezmlm-return
ezmlm-send
ezmlm-split
ezmlm-store
ezmlm-sub
ezmlmsubrc
ezmlm-tstdig
ezmlm-unsub
ezmlm-warn
ezmlm-weed

 

then

for i in `cat foo2`;do mv $i /usr/local/bin/.;done

You need to configure slapd .... for me slapd is a big gray area another sys admin installed and configured it ... check the qmail-ldap website for configuring slapd.

 

Okee Dokee ... tired yet? Anyhow lets move on to getting pop / imap working ....

 

apt-get install courier-pop courier-authdaemon courier-imap courier-authlib-ldap

 

Then update /etc/courier/authdaemonrc

 

authmodulelist="authldap"

 

Then update /etc/courier/authldap

 

LDAP_URI ldap://yourldapserver
LDAP_PORT 389
LDAP_BASEDN dc=yourfoo,dc=com
LDAP_BINDDN cn=Manager,dc=yourfoo,dc=com
LDAP_BINDPW yourpass
LDAP_TIMEOUT 5
LDAP_AUTHBIND 0
LDAP_MAIL mail
LDAP_GLOB_UID vmail
LDAP_GLOB_GID vmail
LDAP_HOMEDIR yourldapfoomaildirpath
LDAP_MAILDIR
LDAP_MAILDIRQUOTA mailQuotaSize
LDAP_FULLNAME cn
LDAP_CRYPTPW userPassword
LDAP_AUXOPTIONS mailhost=mailhost

 

Then restart the authdaemon.....

 

/etc/init.d/courier-authdaemon restart

 

then test .... I update our provisioning tools to create both a mailbox and a list serve on the new node .. then test sending / recieving email / distribution ...

 

 



Page 1 of 1

create discussion Create Discussion