Wietse Venema:
> Wietse Venema:
> > Priyanka Tyagi:
> > > Hello,
> > > 
> > > I am running three Postfix instances (Postfix version - 2.6.2) on a single
> > > host. I have separate postfix configuration files (main.cf and master.cf)
> > > specific to each instance. I have most of the configurations common in all
> > > of the instances. I want to put all common configurations in one file, and
> > > each instance should include configuration details from common file +
> > > specific configuration to that particular instance like data_directory 
> > > etc.
> > > Does Postfix -2.6.2 support such resue of common configurations?
> > > 
> > > Please let me know if you need any other details.
> > 
> > Here is a complete example of how to maintain multiple main.cf files
> > that share common content.
> 
> One missing line added below (first line in the makefile).

OK, third and final attempt.

        Wietse

Contents of /etc/postfix-shared/makefile:
=========================================
POSTFIX1        = /etc/postfix1
POSTFIX2        = /etc/postfix2
COMMON          = /etc/postfix-common

all:    $(POSTFIX1)/main.cf $(POSTFIX2)/main.cf

$(POSTFIX1)/main.cf: $(COMMON)/main.cf $(POSTFIX1)/main.cf-private
        cat $(COMMON)/main.cf $(POSTFIX1)/main.cf-private > $(POSTFIX1)/main.cf
        postfix -c $(POSTFIX1) reload

$(POSTFIX2)/main.cf: $(COMMON)/main.cf $(POSTFIX2)/main.cf-private
        cat $(COMMON)/main.cf $(POSTFIX2)/main.cf-private > $(POSTFIX2)/main.cf
        postfix -c $(POSTFIX2) reload

Commands to update multiple Postfix main.cf files:
==================================================
$ cd /etc/postfix-common
$ vi main.cf
$ make

More details in the make(1) manpage. It is available since 1976 or so.

        Wietse

Reply via email to