Wednesday, March 5, 2008

How to run Qmail on a different port

These steps allow you to setup Qmail on a Plesk server to listen on an alternate port for SMTP as well as the default 25. This is useful if your or your customer’s ISP is blocking outgoing connections to port 25.

Log into the server using SSH.

Edit /etc/services, adding an entry for the alternate SMTP service and its associated port.
>vi /etc/services
For example, if you wanted to use port 9025, you would add the following:
smtp-alt 9025/tcp # Alternate STMP Port

Create a definition for the smtp-alt service in /etc/xinetd.d:
>cd /etc/xinetd.d
>cp smtp_psa smtp_alt_psa

3) Edit smtp_alt_psa:
>vi smtp_alt_psa
Change “service smtp” to “service smtp-alt”. Save the file and quit.

Restart xinetd
>service xinetd restart

Test it out by establishing a telnet connection to the new port. You should see the following:

>telnet localhost PORT
You should see a SMTP banner such as the following:
220 hostname ESMTP

No comments: