Running second instance of qmail

Running several instances of qmail on one server is quite straight forward process. Although there are several ways to do it, I prefer the following one. My goal was to setup second instance of qmail serving SMTP AUTH (587/tcp) requests along with regular SMTP (25/tcp). I mean no separate queues, same dispatcher, same IP, but different ports. Note, that qmail was installed and configured using Life With Qmail (LWQ) instructions.

1. Let’s stop qmail:

svc -d /var/service/qmail-*

2. Copy existing qmail-smtpd directory and call it differently – let’s say qmail-smtpdauth:

cp -R /var/qmail/supervise/qmail-smtpd /var/qmail/supervise/qmail-smtpdauth

3. Edit the run file located in the qmail-smtpdauth and make necessary changes, like changing port number and similar.

4. You may definitely want to have separate log files for the secondary instance:

mkdir /var/log/qmail/qmail-smtpdauth
chown qmaill /var/log/qmail/qmail-smtpdauth

5. Edit /var/qmail/supervise/qmail-smtpdauth/log/run file and make it log to /var/log/qmail/qmail-smtpdauth.

6. Fire up new instance:

ln -s /var/qmail/supervise/qmail-smtpdauth /var/service

7. Check the new instance is up and running:

sockstat -4 | grep 587
qmaild tcpserver 2246 3 tcp4 10.0.12.1:587 *:*

Tags: , ,

Leave a Reply