HSC
Cabinet de consultants en sécurité informatique depuis 1989 - Spécialisé sur Unix, Windows, TCP/IP et Internet
Mode texte : accès au contenu de la page
Hervé Schauer Consultants
Vous êtes ici : Accueil > Ressources > Brèves > Makefile for postfix configuration
Accéder au : Site HSC des formations
Télécharger le catalogue des formations
Recherche :  
English version
   Services   
o Domaines de compétences
o Conseil & Expertise
o Prestations ISO 27001
o Audit & Évaluation
o Tests d'intrusion
o Tests de vulnérabilités (TSAR)
o Analyse Forensique
o Certification ARJEL
o Formations
o E-learning
   Conférences   
o Agenda
o Interventions passées
o Tutoriels
   Ressources   
o Index thématique
o Brèves
o Présentations
o Cours
o Articles
o Outils (téléchargement)
o Veille en vulnérabilité
   Société   
o Hervé Schauer
o Equipe
o Offres d'emploi
o Références
o Historique
o Partenariats
o Associations
   Presse et
 communication
 
 
o Newsletter HSC
o Bulletin juridique HSC
o Revue de presse
o Communiqués de presse
o Publications
   Contacts   
o Coordonnées
o Requêtes particulières
o Accès à nos locaux
o Hôtels proches de nos locaux
|>|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 $



Dernière modification le 12 novembre 2003 à 13:55:00 CET - webmaster@hsc.fr
Mentions légales - Informations sur ce serveur - © 1989-2013 Hervé Schauer Consultants