Qmail on CentOS4

From Wiki
Jump to: navigation, search

Installing Qmail on CentOS can be a bit tricky, here's how I made it work.

First, get rid of sendmail

yum -y remove sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

Now proceed with the qmail install.

Install the SRPM

rpm -Uvh http://qmail.linocomm.net/rpms/SRPMS/qmail-1.03-112patch_14_15.src.rpm

Build it, this will automatically add the qmail users and groups as well:

rpmbuild -bb /usr/src/redhat/SPECS/var-qmail_14_15.spec

Install it:

rpm -ivh /usr/src/redhat/RPMS/i386/qmail-1.03-112patch_14_15.i386.rpm


IMPORTANT

Add the qmail smtp service to the xinetd configuration.  Put the following entry in /etc/xinetd.d/qmail.

service smtp
{
        flags           = REUSE NAMEINARGS
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = qmaild
        server          = /usr/sbin/tcpd
        server_args     = /var/qmail/bin/tcp-env -R /var/qmail/bin/qmail-smtpd
}

Restart xinetd:

service xinetd restart

Start the qmail services:

sh /var/qmail/rc &

You may also want to add this to /etc/rc.local so that it starts on boot.

That's it, your server should be accepting and delivering mail now.