Apr 15

Due to the increase in the number of ISP’s blocking port 25 for third party mailservers I decided to setup my mailserver to answer SMTP request on multiple ports. While this can be accomplished in many ways, such as port forwarding or multiple instances of qmail-smtpd, my situation required setting up a second instance or qmail-smtpd.

The setup process is fairly straight forward. Here are the steps I took to accomplish my goal:

First you will need to stop qmail and make a copy of your qmail-smtpd directory located in /var/qmail/supervise/smtp. I called my new copy /var/qmail/supervise/smtp2. Once the copy had been completed I then needed to edit the run file located in the smtp2 directory. This was a simple change to add the port number I wished to have qmail-smtpd run on. Here is an example:


/usr/local/bin/tcpserver -H -v -R -l “$LOCAL” -x /etc/tcp.smtp.cdb -c “$MAXSMTPD” -u “$QMAILDUID” -g “$NOFILESGID” 0 smtp \


/usr/local/bin/tcpserver -H -v -R -l “$LOCAL” -x /etc/tcp.smtp.cdb -c “$MAXSMTPD” -u “$QMAILDUID” -g “$NOFILESGID” 0 2525 \


Notice the 2525 which is the second port I will be running. Please be aware that this line may be different depending on your installation of QMail. My installation was based on the Life with Qmail instructions and also the addition of SpamAssassin, SpamHaus RBL, relay-ctrl-chk and ClamAV.

With this change complete I needed to update the run file located in the /var/qmail/supervise/smtp2/log directory. I just changed the logging path to log to a second log named smtp2.

Start qmail.

verify:  “netstat -natp|grep tcpserver” and you should see:

tcp        0      0        *                   LISTEN      31692/tcpserver
tcp        0      0      *                   LISTEN      31735/tcpserver


written by MG \\ tags: , , ,