Check out postmulti(1) manual page. Part of postfix package, at least on my debian system. This will let you have separate configurations (including master.cf) started by a single init-script. This works quite well, way better than making something similar manually.
Den 15. aug. 2017 18:35, skrev Viktor Dukhovni: > On Tue, Aug 15, 2017 at 08:20:51PM +0400, Mohammed Khalid Ansari wrote: > >> Can I use multiple instances of postfix on the same host with different >> ports like 25 and 587? > > Each instance has its own master.cf file. The "inet" entries in > that file, toghether with the inet_interfaces setting determine > which TCP listener endpoints are handled by that instance. > > By default, newly created instances have all "inet" services disabled > via "master_service_disable". After your master.cf file matches > your requirements, you can re-enable them and reload the instance. > >> I understand I can start one instance with port 25 and then change the port >> in master.cf and start another one. Will that be OK??? Has anyone tried >> that?? > > Running multiple instances each with an appropriate master.cf is > the purpose of multi-instance support in Postfix. All that you > need to do is to ensure that no instances attempt to bind the same > service IP:port combination (the wildcard IP address generally > conflicts with any explicit address on various operating systems). > >> I don't want to try on my host right now as it would be difficult for me to >> fix if something goes wrong. > > Just stop any unwanted instances, and revert any (usually minor) > changes to the configuration of the default instance. > > Multiple instances are *easier* to work with than a single monolithic > system once your requirements get sufficiently complicated. >