1. Log into your server as root, or any other user with the ability to sudo.
  2. CD to /etc/postfix/
  3. Create a backup of master.cf (cp master.cf master.cf-bak)
  4. Open master.cf with a text editor
  5. Find the line labeled: "smtp inet n......"
  6. Just below the line, insert a new line containing the following:
    587 inet n - n - - smtpd


  1. 587 can be changed to match the port that you wish to use.
  2. Save the file, and exit the text editor.
  3. Run "/etc/init.d/postfix restart" to restart Postfix.



Configure the firewall to accept incoming connections


  1. Add the new port to iptables by running: "iptables -A INPUT -p tcp --dport 587 -j ACCEPT", changing 2525 to the port you choose.
  2. Run "/etc/init.d/iptables save" to save the rule.
  3. Run "/etc/init.d/iptables restart" to apply the new rule.
Kepler Reviewed by Kepler on . ​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: 587 inet n - n - - smtpd Rating: 5