GGuuiiddeelliinneess ffoorr PPaacckkaaggee BBuuiillddeerrss

-------------------------------------------------------------------------------

PPuurrppoossee ooff tthhiiss ddooccuummeenntt

This document has hints and tips for those who manage their own Postfix binary
distribution for internal use, and for those who maintain Postfix binary
distributions for general use.

GGeenneerraall ddiissttrriibbuuttiioonnss:: pplleeaassee pprroovviiddee aa ssmmaallll ddeeffaauulltt mmaaiinn..ccff ffiillee

The installed main.cf file must be small. PLEASE resist the temptation to list
all parameters in the main.cf file. Postfix is supposed to be easy to
configure. Listing all parameters in main.cf defeats the purpose. It is an
invitation for hobbyists to make random changes without understanding what they
do, and gets them into endless trouble.

GGeenneerraall ddiissttrriibbuuttiioonnss:: pplleeaassee iinncclluuddee RREEAADDMMEE oorr HHTTMMLL ffiilleess

Please provide the applicable README or HTML files. They are referenced by the
Postfix manual pages and by other files. Without README or HTML files, Postfix
will be difficult if not impossible to configure.

PPoossttffiixx IInnssttaallllaattiioonn ppaarraammeetteerrss

Postfix installation is controlled by a dozen installation parameters. See the
postfix-install and post-install files for details. Most parameters have
system-dependent default settings that are configurable at compile time, as
described in the INSTALL file.

PPrreeppaarriinngg aa pprree--bbuuiilltt ppaacckkaaggee ffoorr ddiissttrriibbuuttiioonn ttoo ootthheerr ssyysstteemmss

You can build a Postfix package on a machine that does not have Postfix
installed on it. All you need is Postfix source code and a compilation
environment that is compatible with the target system.

You can build a pre-built Postfix package as an unprivileged user.

First compile Postfix. After successful compilation, execute:

     % mmaakkee ppaacckkaaggee

With Postfix versions before 2.2 you must invoke the post-install script
directly (% sshh ppoosstt--iinnssttaallll).

You will be prompted for installation parameters. Specify an install_root
directory other than /. The mail_owner and setgid_group installation parameter
settings will be recorded in the main.cf file, but they won't take effect until
the package is unpacked and installed on the destination machine.

If you want to fully automate this process, specify all the non-default
installation parameters on the command line:

     % mmaakkee nnoonn--iinntteerraaccttiivvee--ppaacckkaaggee iinnssttaallll__rroooott==//ssoommee//wwhheerree...

With Postfix versions before 2.2 you must invoke the post-install script
directly (% sshh ppoosstt--iinnssttaallll --nnoonn--iinntteerraaccttiivvee iinnssttaallll__rroooott......).

BBeeggiinn SSeeccuurriittyy AAlleerrtt

WWhheenn bbuuiillddiinngg aann aarrcchhiivvee ffoorr ddiissttrriibbuuttiioonn,, bbee ssuurree ttoo aarrcchhiivvee oonnllyy ffiilleess aanndd
ssyymmbboolliicc lliinnkkss,, nnoott tthheeiirr ppaarreenntt ddiirreeccttoorriieess.. OOtthheerrwwiissee,, uunnppaacckkiinngg aa pprree--bbuuiilltt
PPoossttffiixx ppaacckkaaggee mmaayy mmeessss uupp ppeerrmmiissssiioonn aanndd//oorr oowwnneerrsshhiipp ooff ssyysstteemm ddiirreeccttoorriieess
ssuucchh aass // //eettcc //uussrr //uussrr//bbiinn //vvaarr //vvaarr//ssppooooll aanndd ssoo oonn.. TThhiiss iiss eessppeecciiaallllyy aann
iissssuuee iiff yyoouu eexxeeccuutteedd ppoossttffiixx--iinnssttaallll ((sseeee aabboovvee)) aass aann uunnpprriivviilleeggeedd uusseerr..

EEnndd SSeeccuurriittyy AAlleerrtt

Thus, to tar up the pre-built package, take the following steps:

    % cd INSTALL_ROOT
    % rm -f SOMEWHERE/outputfile
    % find . \! -type d -print | xargs tar rf SOMEWHERE/outputfile
    % gzip SOMEWHERE/outputfile

This way you will not include any directories that might cause trouble upon
extraction.

IInnssttaalllliinngg aa pprree--bbuuiilltt PPoossttffiixx ppaacckkaaggee

  * To unpack a pre-built Postfix package, execute the equivalent of:

    # umask 022
    # gzip -d <outputfile.tar.gz | (cd / ; tar xvpf -)

    The umask command is necessary for getting the correct permissions on non-
    Postfix directories that need to be created in the process.

  * Create the necessary mail_owner account and setgid_group group for
    exclusive use by Postfix.

  * Execute the postfix command to set ownership and permission of Postfix
    files and directories, and to update Postfix configuration files. If
    necessary, specify any non-default settings for mail_owner or setgid_group
    on the postfix command line:

    # postfix set-permissions upgrade-configuration \
           setgid_group=xxx mail_owner=yyy

    With Postfix versions before 2.1 you achieve the same result by invoking
    the post-install script directly.

