Qmail .. A brief introduction ..

QMAIL

Qmail is an MTA similar to Exim

INSTALLATION

Installation involves the following steps:

1.Installing Qmail itself

2.Installing EZmlm and EZmlm-idx

3.Installing Autoresponder

4.Installing Vpopmail

5.Installing maildrop

6.Uninstalling Sendmail

7.Starting up qmail

You may download these from http://www.qmailrocks.org/downloads/

mkdir /usr/local/src/qmail

Download all the zip folders to the folder qmail

cd /usr/src/qmail/qmail-1.03

make man && make setup check

./config-fast your_fqdn_hostname

(eg: ./config-fast mail.mydomain.com)

Ezmlm

EZmlm is a nice mailing list add-on to Qmail

cd /usr/src/qmail/

tar zxvf ezmlm-0.53-idx-0.41.tar.gz

tar zxvf ezmlm-0.53-idx-0.41.tar.gz

make && make setup

Autoresponder

cd /usr/src/qmail/

tar zxvf autorespond-2.0.5.tar.gz

cd autorespond-2.0.5

make && make install

Vpopmail

Vpopmail is a set of programs for creating and managing multiple virtual domains on a qmail server, with full support for many POP/IMAP servers. A web interface to vpopmail is called Vqadmin

Create a vpopmail user and a vchkpw group

Set up the vpopmail mysql connection config file under the vpopmail users home directory.

echo localhost|0|vpopmailuser|password|vpopmail > ~vpopmail/etc/vpopmail.mysql

chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql

chmod 640 ~vpopmail/etc/vpopmail.mysql

Creating the Database User

Log into your MySQL server as root and type the following commands to create the database for vpopmail.

mysql> CREATE DATBASE vpopmail;

mysql> GRANT ALL ON vpopmail.* TO vpopmail@localhost IDENTIFIED BY yourpassword;

mysql> flush privileges;

cd /usr/src/qmail/

tar zxvf vpopmail-5.4.13.tar.gz

cd vpopmail-5.4.13

./configure enable-logging=p enable-auth-module=mysql disable-passwd enable-clear-passwd disable-many-domains enable-auth-logging enable-sql-logging enable-valias disable-mysql-limits

make && make install-strip

Maildrop

Maildrop is a mail filtering agent which can be used to filter messages as they arrive on the server.

cd /usr/src/qmail/

tar zxvf maildrop-1.6.3.tar.gz

cd maildrop-1.6.3

./configure prefix=/usr/local exec-prefix=/usr/local enable-maildrop-uid=root enable-maildrop-gid=vchkpw enable-maildirquota

make && make install-strip && make install-man

Removing Sendmail

rpm -qa | grep sendmail

If Sendmail is installed as an RPM, you will see an output similar to this:

sendmail-x.x.x.x

sendmail-doc-x.x.x.x

sendmail-devel-x.x.x.x

sendmail-cf-x.x.x.x

If its installed as an RPM, you can uninstall Sendmail quite easily by running the following commands:

/etc/rc.d/init.d/sendmail stop (to stop Sendmail)

rpm -e nodeps sendmail-x.x.x.x

rpm -e nodeps sendmail-doc-x.x.x.x

rpm -e nodeps sendmail-devel-x.x.x.x

rpm -e nodeps sendmail-cf-x.x.x.x

If the RPM query produces no output, you most likely have a source install of Sendmail.

/etc/rc.d/init.d/sendmail stop (to stop Sendmail)

mv /usr/lib/sendmail /usr/lib/sendmail.old

mv /usr/sbin/sendmail /usr/sbin/sendmail.old

chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old

Establishing an artificial Sendmail path

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

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

Starting qmail

qmailctl stop

qmailctl start

You can find out how things are running by: qmailctl stat

You should see an output like this:

/service/qmail-send: up (pid 29956) 2 seconds

/service/qmail-send/log: up (pid 29960) 2 seconds

/service/qmail-smtpd: up (pid 29963) 2 seconds

/service/qmail-smtpd/log: up (pid 29968) 2 seconds

/service/qmail-pop3d: up (pid 29971) 2 seconds

/service/qmail-pop3d/log: up (pid 29972) 2 seconds

messages in queue: 0

messages in queue but not yet preprocessed: 0

Location of qmail logs

/var/log/qmail/qmail-smtpd/

/var/log/qmail/qmail-send/

/var/log/qmail/qmail-pop3d/

How can I decipher qmail logs?

1. Search the logs for info msg N: bytes M from SENDER entries.

2. Note the message ID, N.

3. Search forward for starting delivery K: msg N to remote/local RECIPIENT entries.

4. For each one you find before the first end msg N entry, youve discovered a recipient.

Article Authored by Junitha Mayana

Author, Junitha Mayana, is a Systems Engineer with SupportPRO. Junitha specializes in Level 2 and Level 3 Linux / Windows Administration. SupportPRO offers 24X7 technical support services to Web hosting companies and service providers.

Leave a Reply