Set alternative SMTP port in Plesk Linux server

Some time local ISP blocked default SMTP port 25 in the local network therefore we have to configure the alternative smtp port for SMTP service, so that SMTP will work on default port 25 as well as other new port. For example we are configuring the SMTP service on port 2626. Refer to the following steps to configure SMTP service on another port.

Change directory to the /etc/xinetd.d

root@server [~]#cd /etc/xinetd.d

Now copy the current working smtp_psa file to the new file smtp_psa_new

root@server [/etc/xinetd.d]#cp -p smtp_psa smtp_psa_new

open the file smtp_psa_new and change the value in the first line

From
service smtp
to
service smtp_psa_new

Save the file  and add the new smpt port in the /etc/services file

For example we want to set new smtp port 2626, you can change the port as per your requirement

smtp_psa_new 2626/tcp mail
smtp_psa_new 2626/udp mail

Save the file and restart the xinetd service

root@server [/etc/xinetd.d]#/etc/init.d/xinetd restart

Make sure that you have opened new port in the server firewall and then try to telenet the new SMTP port

root@server [/etc/xinetd.d]#telnet localhost 2626

It will show you the SMTP service banner

About Anant 384 Articles
Senior technical writer