Network Security Consulting Agency Since 1989 - Specialized in Unix, Windows, TCP/IP and Internet
Text mode: access to the page content
Hervé Schauer Consultants
You are here: Home > Resources > Tips > Makefile for postfix configuration
Go to: HSC Trainings
Télécharger le catalogue des formations
Version française
o Skills & Expertise
o Consulting
o ISO 27001 services
o Audit & Assessment
o Penetration tests
o Vunerability assessment (TSAR)
o Forensics
o Training courses
o E-learning
o Agenda
o Past events
o Tutorials
o Thematic index
o Tips
o Lectures
o Courses
o Articles
o Tools (download)
o Vulnerability watch
o Hervé Schauer
o Team
o Job opportunities
o Credentials
o History
o Partnerships
o Associations
   Press and
o HSC Newsletter
o Bulletin juridique HSC
o Press review
o Press releases
o Publications
o How to reach us
o Specific inquiries
o Directions to our office
o Hotels near our office
|>|Makefile for postfix configuration  

by 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}


all:    banner ${HASHES_DB} aliases.db
	echo \= Done.

	echo \= Postfix Configuration Makefile
	echo \= Nicolas.Jombart \| Stephane.Aubert
	echo \= @hsc-labs.com

reload: banner aliases.db ${HASHES_DB}
	echo  . Reloading POSTFIX ...
	${POSTFIX} reload
	echo \= Done.

aliases.db:   aliases
	echo . Rebuilding aliases database ...

${HASHES_DB}:   %.db: %
	echo . Rebuilding $< database ...
	${POSTMAP} $<

Références :

[1] http://www.postfix.org/

$Id: postfix-makefile.en.tip,v 1.3 2001/12/22 21:28:42 seyrat Exp $

Last modified on 12 November 2003 at 13:55:00 CET - webmaster@hsc.fr
Mentions légales - Information on this server - © 1989-2013 Hervé Schauer Consultants