1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "https://www.w3.org/TR/html4/loose.dtd"> 3 4 <html> 5 6 <head> 7 8 <title>Guidelines for Package Builders</title> 9 10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 11 <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 12 13 </head> 14 15 <body> 16 17 <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Guidelines for Package Builders</h1> 18 19 <hr> 20 21 <h2>Purpose of this document</h2> 22 23 <p> This document has hints and tips for those who manage their 24 own Postfix binary distribution for internal use, and for those who 25 maintain Postfix binary distributions for general use. </p> 26 27 <h2>General distributions: please provide a small default main.cf 28 file</h2> 29 30 <p> The installed <a href="postconf.5.html">main.cf</a> file must be small. PLEASE resist the 31 temptation to list all parameters in the <a href="postconf.5.html">main.cf</a> file. Postfix 32 is supposed to be easy to configure. Listing all parameters in <a href="postconf.5.html">main.cf</a> 33 defeats the purpose. It is an invitation for hobbyists to make 34 random changes without understanding what they do, and gets them 35 into endless trouble. </p> 36 37 <h2>General distributions: please include README or HTML files</h2> 38 39 <p> Please provide the applicable README or HTML files. They are 40 referenced by the Postfix manual pages and by other files. Without 41 README or HTML files, Postfix will be difficult if not impossible 42 to configure. </p> 43 44 <h2>Postfix Installation parameters</h2> 45 46 <p> Postfix installation is controlled by a dozen installation 47 parameters. See the postfix-install and post-install files for 48 details. Most parameters have system-dependent default settings 49 that are configurable at compile time, as described in the <a href="INSTALL.html">INSTALL</a> 50 file. </p> 51 52 <h2>Preparing a pre-built package for distribution to other 53 systems</h2> 54 55 <p> You can build a Postfix package on a machine that does not have 56 Postfix installed on it. All you need is Postfix source code and 57 a compilation environment that is compatible with the target system. 58 </p> 59 60 <p> You can build a pre-built Postfix package as an unprivileged 61 user. </p> 62 63 <p> First compile Postfix. After successful compilation, execute: 64 </p> 65 66 <blockquote> <pre> % <b>make package</b> </pre> 67 </blockquote> 68 69 <p> With Postfix versions before 2.2 you must invoke the post-install 70 script directly (<tt>% <b>sh post-install</b></tt>). </p> 71 72 <p> You will be prompted for installation parameters. Specify an 73 install_root directory other than /. The <a href="postconf.5.html#mail_owner">mail_owner</a> and <a href="postconf.5.html#setgid_group">setgid_group</a> 74 installation parameter settings will be recorded in the <a href="postconf.5.html">main.cf</a> 75 file, but they won't take effect until the package is unpacked and 76 installed on the destination machine. </p> 77 78 <p> If you want to fully automate this process, specify all the 79 non-default installation parameters on the command line: </p> 80 81 <blockquote> 82 <pre> % <b>make non-interactive-package install_root=/some/where</b>... 83 </pre> </blockquote> 84 85 <p> With Postfix versions before 2.2 you must invoke the post-install 86 script directly (<tt>% <b>sh post-install -non-interactive 87 install_root...</b></tt>). </p> 88 89 <p> With Postfix 3.0 and later, the command "make package name=value 90 ..." will replace the string MAIL_VERSION in a configuration parameter 91 value with the Postfix release version. Do not try to specify 92 something like $<a href="postconf.5.html#mail_version">mail_version</a> on this command line. This produces 93 inconsistent results with different versions of the make(1) command. 94 </p> 95 96 <h2>Begin Security Alert</h2> 97 98 <p> <b> When building an archive for distribution, be sure to 99 archive only files and symbolic links, not their parent directories. 100 Otherwise, unpacking a pre-built Postfix package may mess up 101 permission and/or ownership of system directories such as / /etc 102 /usr /usr/bin /var /var/spool and so on. This is especially an 103 issue if you executed postfix-install (see above) as an unprivileged 104 user. </b> </p> 105 106 <h2>End Security Alert</h2> 107 108 <p> Thus, to tar up the pre-built package, take the following steps: 109 </p> 110 111 <blockquote> <pre> 112 % cd INSTALL_ROOT 113 % rm -f SOMEWHERE/outputfile 114 % find . \! -type d -print | xargs tar rf SOMEWHERE/outputfile 115 % gzip SOMEWHERE/outputfile </pre> </blockquote> 116 117 <p>This way you will not include any directories that might cause 118 trouble upon extraction. </p> 119 120 <h2>Installing a pre-built Postfix package</h2> 121 122 <ul> 123 124 <li> <p> To unpack a pre-built Postfix package, execute the equivalent 125 of: </p> 126 127 <pre> 128 # umask 022 129 # gzip -d <outputfile.tar.gz | (cd / ; tar xvpf -) </pre> 130 131 <p> The umask command is necessary for getting the correct permissions 132 on non-Postfix directories that need to be created in the process. 133 </p> 134 135 <li> <p> Create the necessary <a href="postconf.5.html#mail_owner">mail_owner</a> account and <a href="postconf.5.html#setgid_group">setgid_group</a> 136 group for exclusive use by Postfix. </p> 137 138 <li> <p> Execute the postfix command to set ownership and permission 139 of Postfix files and directories, and to update Postfix configuration 140 files. If necessary, specify any non-default settings for <a href="postconf.5.html#mail_owner">mail_owner</a> 141 or <a href="postconf.5.html#setgid_group">setgid_group</a> on the postfix command line: </p> 142 143 <pre> 144 # postfix set-permissions upgrade-configuration \ 145 <a href="postconf.5.html#setgid_group">setgid_group</a>=xxx <a href="postconf.5.html#mail_owner">mail_owner</a>=yyy 146 </pre> 147 148 <p> With Postfix versions before 2.1 you achieve the same result 149 by invoking the post-install script directly. </p> 150 151 </ul> 152 153 </body> 154 155 </html> 156