Step 1: Connect to the Server via SSH
Step 2: Edit the Postfix Configuration
Step 3: Allow the New Port in the Firewall
Step 5: Update Mail Client Settings

If you want to change the default SMTP port (usually 25) on a Linux server using Plesk Panel, follow this practical step-by-step guide:

Step 1: Connect to the Server via SSH

Use your root credentials to connect to the server via SSH.

ssh root@your-server-ip

Step 2: Edit the Postfix Configuration

Open the Postfix master configuration file:
nano /etc/postfix/master.cf

Find the line that starts with smtp and duplicate it for your custom port. For example, to use port 587:
smtp inet n - n - - smtpd
587 inet n - n - - smtpd

Step 3: Allow the New Port in the Firewall

If you are using firewalld:

firewall-cmd --permanent --add-port=587/tcp
firewall-cmd --reload

For iptables:
iptables -A INPUT -p tcp --dport 587 -j ACCEPT
service iptables save


Step 4: Restart Postfix

systemctl restart postfix

 

Step 5: Update Mail Client Settings

Make sure your email clients (like Outlook or Thunderbird) are configured to use the new SMTP port (e.g., 587 or 465).


That’s it! You've successfully changed the SMTP port in Plesk on a Linux server.

If the port is blocked by your hosting provider or ISP, consider contacting them or using an alternative like port 2525.

 
Did you find it useful?
(34 times viewed / 0 people found it helpful)