How to Configure Postfix to use an Alternate Port for SMTP
Configure Postfix to use an alternate port for SMTP
Log into your server as root, or any other user with the ability to sudo.
CD to /etc/postfix/
Create a backup of master.cf (cp master.cf master.cf-bak)
Open master.cf with a text editor
Find the line labeled: "smtp inet n......"
Just below the line, insert a new line containing the following:
2525 inet n - n - - smtpd
2525 can be changed to match the port that you wish to use.
Save the file, and exit the text editor.
Run "/etc/init.d/postfix restart" to restart Postfix.
Configure the firewall to accept incoming connections
Add the new port to iptables by running: "iptables -A INPUT -p tcp --dport 2525 -j ACCEPT", changing 2525 to the port you choose.
Run "/etc/init.d/iptables save" to save the rule.
Run "/etc/init.d/iptables restart" to apply the new rule.
Article ID: 2283
Created: September 24, 2015 at 12:50 PM
Modified: October 2, 2015 at 4:27 PM
Was this article helpful?
Thanks for your feedback...
75% of people found this helpful.
Share this article
Send Reset Email
Please log in below
Not Logged In
You must be logged in to perform this action.