Dave's Brain

Browse - computer tips - postfix db files automatically rebuilt with configuration file changes

Date: 2010apr29
Product: postfix

Q.  Is there a way to automatically rebuild the postfix .db files
when the corresponding configuration file changes?

A.  Yes, you can use a "make" to do this.

Its explained in great detail here:
http://www.unixwiz.net/techtips/postfix-makefiles.html

If you create a Makefile (which I have done) then can just do:

	make

in /etc/postfix when you have changed a configuration file.  Very handy.
I have also modified the script which starts Postfix to do a make
just in case.  In file  /etc/rc.d/init.d/postfix I added:

        echo -n $"Starting postfix: "

        (
                cd /etc/postfix
                make | grep -v 'Nothing to be done for'
        )

        ### Commented out since done by the make above
        ### make_aliasesdb >/dev/null 2>&1

Perhaps surprisingly, you do always not have restart Postfix to make
the change come into effect.  As explained here:
http://www.seaglass.com/postfix/faq.html#rldpf
".db files are not read into memory [by the Postfix daemons] and
don't require reloading."

What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: