« Get your very own "Rosie" domestic helper. | Main | New Laptop - Dell Inspiron 9300 »
September 27, 2005
Running QMail SMTP on a 2nd port
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 make a copy of your qmail-smtpd directory located in /var/qmail/supervise. I called my new copy qmail-smtpd2. Once the copy had been completed I then needed to edit the run file located in the qmail-smtpd2 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 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 qmail-smtpd2/log directory. I just changed the logging path to log to a second log named qmail-smtpd2.
I then needed to create a symlink to the new /var/qmail/supervise/qmail-smtpd2 in the /service directory, for example:
ln -s /var/qmail/supervise/qmail-smtpd2 /service/qmail-smtpd2
Finally the last changes required updating my qmailctl script to include the new qmail-smtpd2 setup. This was a matter of making a duplicate of the existing qmail-smtpd commands and modifying them with the new name of qmail-smtpd2. For example:
if svok /service/qmail-smtpd2 ; thensvc -u /service/qmail-smtpd2
else
echo qmail-smtpd2 service not running
fi
Please note the above is only one of the changes you will need to make in the qmailctl script.
Then I restarted qmail using the qmailctl stop and start commands. Qmail was now listening on both port 25 and 2525.
Posted by skorpion at September 27, 2005 06:50 PM

