|
|
 | |  |  | Makefile for postfix configuration |  |
par Nicolas Jombart - Stéphane Aubert (28/11/2001)
Makefile for the postfix configuration
--------------------------------------
The well-known Postfix MTA [1] has becomed heavily used on the internet,
thanks to its well-written code, modularity and configuration simplicity.
This document deals with Postfix's configuration that lives by default
in the /etc/postfix directory. The informations are splitted in several
files :
. main.cf : general configuration
. master.cf : daemons control
And some files usually used in .db form :
. aliases : mail aliases table
. virtual : virtual domains adresses
. canonical : canonical maps
. transport : mail transport table
. etc.
(names can change to fit your configuration habits)
Almost every information could be written in a file and accessed via the
.db form by specifying var = hash:/etc/postfix/mytable in main.cf
So these files must be compiled with :
postalias aliases
And for the other (virtual, etc.) :
postmap virtual
In fact, aliases is usually the exception and must be compiled with postalias.
The aliases file has the following syntax :
alias: real_user
And the others :
key value
whithout the ":".
These commands MUST be executed each time you modify such a file.
The following Makefile will allow you, by typing the "make" command, to
recreate the .db files (and reload the postfix system) if needed.
Note that this Makefile should be customized to fit to your system, in
particular look at the value of the HASHES variable.
# Makefile for postfix configuration
# Nicolas.Jombart@hsc-labs.com - 15.11.2001
# rewritten by Stephane.Aubert@hsc-labs.com
NEWALIASES= /usr/bin/newaliases
POSTMAP= /usr/sbin/postmap
POSTFIX= /usr/sbin/postfix
HASHES= transport access virtual sender_canonical tls_per_site
HASHES_DB= ${HASHES:=.db}
.SILENT:
all: banner ${HASHES_DB} aliases.db
echo \= Done.
banner:
echo \= Postfix Configuration Makefile
echo \= Nicolas.Jombart \| Stephane.Aubert
echo \= @hsc-labs.com
echo
reload: banner aliases.db ${HASHES_DB}
echo . Reloading POSTFIX ...
${POSTFIX} reload
echo \= Done.
aliases.db: aliases
echo . Rebuilding aliases database ...
${NEWALIASES}
${HASHES_DB}: %.db: %
echo . Rebuilding $< database ...
${POSTMAP} $<
Références :
[1] http://www.postfix.org/
http://www.hsc.fr/ressources/breves/postfix-tls.html
$Id: postfix-makefile.en.tip,v 1.3 2001/12/22 21:28:42 seyrat Exp $
|