How to change SMTP port in postfix
The default SMTP port is 25. In Postfix we can change it to some other port (say 6000) using the following steps.
Open the file master.cf.
$ vi /etc/postfix/master.cf
Add the following line to the file.
6000 inet n - n - - smtpd
Restart postfix.
$ /etc/init.d/postfix restart
You can check the connection to the new port using telnet. Also make sure that the new port is not blocked in the server firewall.
Changing the Webmin Port from the Command Line
Changing the port on which Webmin runs after installation is also a pretty simple process. Simply edit the file miniserv.conf in the /etc directory where your Webmin configuration files were installed (this is likely one of the following: /etc/webmin, /usr/local/webmin/etc, or /opt/webmin/etc). You’ll find a port directive. Change this to whatever port you need Webmin to listen on, and then restart the Webmin web server.
Restarting the Webmin server can be accomplished in a few different ways depending on the OS and version. Under Red Hat Linux and its derivatives, for example, you would use the standard service command:
#/sbin/service webmin stop
#/sbin/service webmin start
If your OS does not have a standardized service control tool like service, you may use the standard Webmin stop and start scripts located in the Webmin etc directory:
# /etc/webmin/stop; /etc/webmin/start
The miniserv.conf file contains many other options, but you will only need to edit a few manually. Other common problems that users run into include restricting their access by IP. This can cause them a problem if their service provider changes the IP. Simply mistyping an IP can also lead to the same trouble. The remedy for this problem is to add the correct IP to the allow= directive and then restart the Webmin server.