What is an SMTP port?
SMTP is the system that sends email. A port is like a numbered door on a server. Each service uses its own door. SMTP normally uses port 25. Some internet providers block port 25, so people open another door, such as 587 or 2525.
Before you start
A wrong change can stop your email from working. Take a backup of the config file first. Also keep one SSH session open while you test. SSH is a safe way to control a server by typing commands.
Steps for Exim
Exim is a common mail program on cPanel servers. Other systems differ, so check which mail program you use.
- Log in to your server over SSH as root.
- Back up the file:
cp /etc/exim.conf /etc/exim.conf.bak
This makes a safe copy named exim.conf.bak.
- If you use WHM, open Service Configuration and then Exim Configuration Manager. Look for the option that sets extra ports, often called Port for SMTP to listen on. Add your new port, for example 2525.

- Save the setting. WHM rebuilds the config and restarts Exim for you.
Steps for Postfix
- Open the file
/etc/postfix/master.cfin an editor such as nano. - Find the line starting with
smtp inet. - Add a new line using your port number, for example
2525 inet n - n - - smtpd. - Save the file.
- Restart Postfix:
systemctl restart postfix
This stops and starts the mail program so it reads the new setting.
Open the port in the firewall
A firewall blocks unwanted doors. Allow your new port. For example, with CSF:
csf -a 0.0.0.0/0 -p 2525
Or edit the allowed incoming ports list in the CSF config. With firewalld:
firewall-cmd --permanent --add-port=2525/tcp
firewall-cmd --reload
Test it
telnet localhost 2525
If you see a line starting with 220, the port works.
Quick recap
- Port 25 is the default SMTP port. Some providers block it.
- Back up the config before editing.
- Add the new port in Exim or Postfix.
- Restart the mail service.
- Allow the port in the firewall, then test.