Computer Tips - Postfix: Is there a way to automatically rebuild the postfix .db files

Date: 2010apr29 Product: postfix Warning: Not using systemd Q. Postfix: 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."