1 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx I
\bIn
\bns
\bst
\bta
\bal
\bll
\bla
\bat
\bti
\bio
\bon
\bn F
\bFr
\bro
\bom
\bm S
\bSo
\bou
\bur
\brc
\bce
\be C
\bCo
\bod
\bde
\be
3 -------------------------------------------------------------------------------
5 1
\b1 -
\b- P
\bPu
\bur
\brp
\bpo
\bos
\bse
\be o
\bof
\bf t
\bth
\bhi
\bis
\bs d
\bdo
\boc
\bcu
\bum
\bme
\ben
\bnt
\bt
7 If you are using a pre-compiled version of Postfix, you should start with
8 BASIC_CONFIGURATION_README and the general documentation referenced by it.
9 INSTALL is only a bootstrap document to get Postfix up and running from scratch
10 with the minimal number of steps; it should not be considered part of the
11 general documentation.
13 This document describes how to build, install and configure a Postfix system so
14 that it can do one of the following:
16 * Send mail only, without changing an existing Sendmail installation.
17 * Send and receive mail via a virtual host interface, still without any
18 change to an existing Sendmail installation.
19 * Run Postfix instead of Sendmail.
21 Topics covered in this document:
23 1. Purpose of this document
24 2. Typographical conventions
26 4. Building on a supported system
27 5. Porting Postfix to an unsupported system
28 6. Installing the software after successful compilation
29 7. Configuring Postfix to send mail only
30 8. Configuring Postfix to send and receive mail via virtual interface
31 9. Running Postfix instead of Sendmail
32 10. Mandatory configuration file edits
33 11. To chroot or not to chroot
34 12. Care and feeding of the Postfix system
36 2
\b2 -
\b- T
\bTy
\byp
\bpo
\bog
\bgr
\bra
\bap
\bph
\bhi
\bic
\bca
\bal
\bl c
\bco
\bon
\bnv
\bve
\ben
\bnt
\bti
\bio
\bon
\bns
\bs
38 In the instructions below, a command written as
42 should be executed as the superuser.
48 should be executed as an unprivileged user.
50 3
\b3 -
\b- D
\bDo
\boc
\bcu
\bum
\bme
\ben
\bnt
\bta
\bat
\bti
\bio
\bon
\bn
52 Documentation is available as README files (start with the file README_FILES/
53 AAAREADME), as HTML web pages (point your browser to "html/index.html") and as
54 UNIX-style manual pages.
56 You should view the README files with a pager such as more(1) or less(1),
57 because the files use backspace characters in order to produce b
\bbo
\bol
\bld
\bd font. To
58 print a README file without backspace characters, use the col(1) command. For
63 In order to view the manual pages before installing Postfix, point your MANPATH
64 environment variable to the "man" subdirectory; be sure to use an absolute
67 % export MANPATH; MANPATH="`pwd`/man:$MANPATH"
68 % setenv MANPATH "`pwd`/man:$MANPATH"
70 Of particular interest is the postconf(5) manual page that lists all the 500+
71 configuration parameters. The HTML version of this text makes it easy to
74 All Postfix source files have their own built-in manual page. Tools to extract
75 those embedded manual pages are available in the mantools directory.
77 4
\b4 -
\b- B
\bBu
\bui
\bil
\bld
\bdi
\bin
\bng
\bg o
\bon
\bn a
\ba s
\bsu
\bup
\bpp
\bpo
\bor
\brt
\bte
\bed
\bd s
\bsy
\bys
\bst
\bte
\bem
\bm
79 At some point in time, a version of Postfix was supported on:
81 AIX 3.2.5, 4.1.x, 4.2.0, 4.3.x, 5.2
84 FreeBSD 2.x, 3.x, 4.x, 5.x
87 Linux Debian 1.3.1, 2.x, 3.x
88 Linux RedHat 3.x (January 2004) - 9.x
89 Linux Slackware 3.x, 4.x, 7.x
90 Linux SuSE 5.x, 6.x, 7.x
91 Linux Ubuntu 4.10..7.04
96 OSF1.V3 - OSF1.V5 (Digital UNIX)
99 SunOS 4.1.4 (March 2007)
100 SunOS 5.4 - 5.10 (Solaris 2.4..10)
101 Ultrix 4.x (well, that was long ago)
103 or something closely resemblant.
105 4
\b4.
\b.1
\b1 -
\b- G
\bGe
\bet
\btt
\bti
\bin
\bng
\bg s
\bst
\bta
\bar
\brt
\bte
\bed
\bd
107 On Solaris, the "make" command and other utilities for software development are
108 in /usr/ccs/bin, so you MUST have /usr/ccs/bin in your command search path. If
109 these files do not exist, install the development packages first. See the
110 Solaris FAQ item "Which packages do I need to install to support a C
113 If you need to build Postfix for multiple architectures, use the "lndir"
114 command to build a shadow tree with symbolic links to the source files. "lndir"
117 If at any time in the build process you get messages like: "make: don't know
118 how to ..." you should be able to recover by running the following command from
119 the Postfix top-level directory:
121 % make -f Makefile.init makefiles
123 If you copied the Postfix source code after building it on another machine, it
124 is a good idea to cd into the top-level directory and first do this:
128 This will get rid of any system dependencies left over from compiling the
131 4
\b4.
\b.2
\b2 -
\b- W
\bWh
\bha
\bat
\bt c
\bco
\bom
\bmp
\bpi
\bil
\ble
\ber
\br t
\bto
\bo u
\bus
\bse
\be
133 To build with GCC, or with the native compiler if people told me that is better
134 for your system, just cd into the top-level Postfix directory of the source
139 To build with a non-default compiler, you need to specify the name of the
140 compiler. Here are a few examples:
142 % make makefiles CC=/opt/SUNWspro/bin/cc (Solaris)
145 % make makefiles CC="/opt/ansic/bin/cc -Ae" (HP-UX)
148 % make makefiles CC="purify cc"
151 and so on. In some cases, optimization is turned off automatically.
153 4
\b4.
\b.3
\b3 -
\b- B
\bBu
\bui
\bil
\bld
\bdi
\bin
\bng
\bg w
\bwi
\bit
\bth
\bh o
\bop
\bpt
\bti
\bio
\bon
\bna
\bal
\bl e
\bex
\bxt
\bte
\ben
\bns
\bsi
\bio
\bon
\bns
\bs
155 By default, Postfix builds as a mail system with relatively few bells and
156 whistles. Support for third-party databases etc. must be configured when
157 Postfix is compiled. The following documents describe how to build Postfix with
158 support for extensions:
160 _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b
161 |P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx e
\bex
\bxt
\bte
\ben
\bns
\bsi
\bio
\bon
\bn |D
\bDo
\boc
\bcu
\bum
\bme
\ben
\bnt
\bt |A
\bAv
\bva
\bai
\bil
\bla
\bab
\bbi
\bil
\bli
\bit
\bty
\by|
162 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
163 |Berkeley DB database |DB_README |Postfix 1.0 |
164 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
165 |LDAP database |LDAP_README |Postfix 1.0 |
166 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
167 |MySQL database |MYSQL_README|Postfix 1.0 |
168 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
169 |Perl compatible regular expression|PCRE_README |Postfix 1.0 |
170 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
171 |PostgreSQL database |PGSQL_README|Postfix 2.0 |
172 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
173 |SASL authentication |SASL_README |Postfix 1.0 |
174 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
175 |STARTTLS session encryption |TLS_README |Postfix 2.2 |
176 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
178 Note: IP version 6 support is compiled into Postfix on operating systems that
179 have IPv6 support. See the IPV6_README file for details.
181 4
\b4.
\b.4
\b4 -
\b- O
\bOv
\bve
\ber
\brr
\bri
\bid
\bdi
\bin
\bng
\bg b
\bbu
\bui
\bil
\blt
\bt-
\b-i
\bin
\bn p
\bpa
\bar
\bra
\bam
\bme
\bet
\bte
\ber
\br d
\bde
\bef
\bfa
\bau
\bul
\blt
\bt s
\bse
\bet
\btt
\bti
\bin
\bng
\bgs
\bs
183 All Postfix configuration parameters can be changed by editing a Postfix
184 configuration file, except for one: the parameter that specifies the location
185 of Postfix configuration files. In order to build Postfix with a configuration
186 directory other than /etc/postfix, use:
188 % make makefiles CCARGS='-DDEF_CONFIG_DIR=\"/some/where\"'
191 IMPORTANT: Be sure to get the quotes right. These details matter a lot.
193 Parameters whose defaults can be specified in this way are:
195 _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b
196 |M
\bMa
\bac
\bcr
\bro
\bo n
\bna
\bam
\bme
\be |d
\bde
\bef
\bfa
\bau
\bul
\blt
\bt v
\bva
\bal
\blu
\bue
\be f
\bfo
\bor
\br|t
\bty
\byp
\bpi
\bic
\bca
\bal
\bl d
\bde
\bef
\bfa
\bau
\bul
\blt
\bt |
197 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
198 |DEF_COMMAND_DIR |command_directory|/usr/sbin |
199 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
200 |DEF_CONFIG_DIR |config_directory |/etc/postfix |
201 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
202 |DEF_DAEMON_DIR |daemon_directory |/usr/libexec/postfix|
203 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
204 |DEF_DATA_DIR |data_directory |/var/lib/postfix |
205 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
206 |DEF_MAILQ_PATH |mailq_path |/usr/bin/mailq |
207 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
208 |DEF_HTML_DIR |html_directory |no |
209 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
210 |DEF_MANPAGE_DIR |manpage_directory|/usr/local/man |
211 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
212 |DEF_NEWALIAS_PATH|newaliases_path |/usr/bin/newaliases |
213 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
214 |DEF_QUEUE_DIR |queue_directory |/var/spool/postfix |
215 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
216 |DEF_README_DIR |readme_directory |no |
217 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
218 |DEF_SENDMAIL_PATH|sendmail_path |/usr/sbin/sendmail |
219 |_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
221 Note: the data_directory parameter (for caches and pseudo-random numbers) was
222 introduced with Postfix version 2.5.
224 4
\b4.
\b.5
\b5 -
\b- S
\bSu
\bup
\bpp
\bpo
\bor
\brt
\bt f
\bfo
\bor
\br t
\bth
\bho
\bou
\bus
\bsa
\ban
\bnd
\bds
\bs o
\bof
\bf p
\bpr
\bro
\boc
\bce
\bes
\bss
\bse
\bes
\bs
226 The number of connections that Postfix can manage simultaneously is limited by
227 the number of processes that it can run. This number in turn is limited by the
228 number of files and sockets that a single process can open. For example, the
229 Postfix queue manager has a separate connection to each delivery process, and
230 the anvil(8) server has one connection per smtpd(8) process.
232 Postfix version 2.4 and later have no built-in limits on the number of open
233 files or sockets, when compiled on systems that support one of the following:
235 * BSD kqueue(2) (FreeBSD 4.1, NetBSD 2.0, OpenBSD 2.9),
236 * Solaris 8 /dev/poll,
237 * Linux 2.6 epoll(4).
239 With other Postfix versions or operating systems, the number of file
240 descriptors per process is limited by the value of the FD_SETSIZE macro. If you
241 expect to run more than 1000 mail delivery processes, you may need to override
242 the definition of the FD_SETSIZE macro to make select() work correctly:
244 % make makefiles CCARGS=-DFD_SETSIZE=2048
246 Warning: the above has no effect on some Linux versions. Apparently, on these
247 systems the FD_SETSIZE value can be changed only by using undocumented
248 interfaces. Currently, that means including <bits/types.h> directly (which is
249 not allowed) and overriding the __FD_SETSIZE macro. Beware, undocumented
250 interfaces can change at any time and without warning.
252 But wait, there is more: none of this will work unless the operating system is
253 configured to handle thousands of connections. See the TUNING_README guide for
254 examples of how to increase the number of open sockets or files.
256 4
\b4.
\b.6
\b6 -
\b- C
\bCo
\bom
\bmp
\bpi
\bil
\bli
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx,
\b, a
\bat
\bt l
\bla
\bas
\bst
\bt
262 is successful, then you can proceed to install Postfix (section 6).
264 If the command produces compiler error messages, it may be time to search the
265 web or to ask the postfix-users@postfix.org mailing list, but be sure to search
266 the mailing list archives first. Some mailing list archives are linked from
267 http://www.postfix.org/.
269 5
\b5 -
\b- P
\bPo
\bor
\brt
\bti
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx t
\bto
\bo a
\ban
\bn u
\bun
\bns
\bsu
\bup
\bpp
\bpo
\bor
\brt
\bte
\bed
\bd s
\bsy
\bys
\bst
\bte
\bem
\bm
271 Each system type that Postfix knows is identified by a unique name. Examples:
272 SUNOS5, FREEBSD4, and so on. When porting Postfix to a new system, the first
273 step is to choose a SYSTEMTYPE name for the new system. You must use a name
274 that includes at least the major version of the operating system (such as
275 SUNOS4 or LINUX2), so that different releases of the same system can be
276 supported without confusion.
278 Add a case statement to the "makedefs" shell script in the source code top-
279 level directory that recognizes the new system reliably, and that emits the
280 right system-specific information. Be sure to make the code robust against user
281 PATH settings; if the system offers multiple UNIX flavors (e.g. BSD and SYSV)
282 be sure to build for the native flavor, instead of the emulated one.
284 Add an "#ifdef SYSTEMTYPE" section to the central util/sys_defs.h include file.
285 You may have to invent new feature macro names. Please choose sensible feature
286 macro names such as HAS_DBM or FIONREAD_IN_SYS_FILIO_H.
288 I strongly recommend against using "#ifdef SYSTEMTYPE" in individual source
289 files. While this may look like the quickest solution, it will create a mess
290 when newer versions of the same SYSTEMTYPE need to be supported. You're likely
291 to end up placing "#ifdef" sections all over the source code again.
293 6
\b6 -
\b- I
\bIn
\bns
\bst
\bta
\bal
\bll
\bli
\bin
\bng
\bg t
\bth
\bhe
\be s
\bso
\bof
\bft
\btw
\bwa
\bar
\bre
\be a
\baf
\bft
\bte
\ber
\br s
\bsu
\buc
\bcc
\bce
\bes
\bss
\bsf
\bfu
\bul
\bl c
\bco
\bom
\bmp
\bpi
\bil
\bla
\bat
\bti
\bio
\bon
\bn
295 This text describes how to install Postfix from source code. See the
296 PACKAGE_README file if you are building a package for distribution to other
299 6
\b6.
\b.1
\b1 -
\b- S
\bSa
\bav
\bve
\be e
\bex
\bxi
\bis
\bst
\bti
\bin
\bng
\bg S
\bSe
\ben
\bnd
\bdm
\bma
\bai
\bil
\bl b
\bbi
\bin
\bna
\bar
\bri
\bie
\bes
\bs
301 IMPORTANT: if you are REPLACING an existing Sendmail installation with Postfix,
302 you may need to keep the old sendmail program running for some time in order to
303 flush the mail queue.
305 * Some systems implement a mail switch mechanism where different MTAs
306 (Postfix, Sendmail, etc.) can be installed at the same time, while only one
307 of them is actually being used. Examples of such switching mechanisms are
308 the FreeBSD mailwrapper(8) or the Linux mail switch. In this case you
309 should try to "flip" the switch to "Postfix" before installing Postfix.
311 * If your system has no mail switch mechanism, execute the following commands
312 (your sendmail, newaliases and mailq programs may be in a different place):
314 # mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
315 # mv /usr/bin/newaliases /usr/bin/newaliases.OFF
316 # mv /usr/bin/mailq /usr/bin/mailq.OFF
317 # chmod 755 /usr/sbin/sendmail.OFF /usr/bin/newaliases.OFF \
320 6
\b6.
\b.2
\b2 -
\b- C
\bCr
\bre
\bea
\bat
\bte
\be a
\bac
\bcc
\bco
\bou
\bun
\bnt
\bt a
\ban
\bnd
\bd g
\bgr
\bro
\bou
\bup
\bps
\bs
322 Before you install Postfix for the first time you need to create an account and
325 * Create a user account "postfix" with a user id and group id that are not
326 used by any other user account. Preferably, this is an account that no-one
327 can log into. The account does not need an executable login shell, and
328 needs no existing home directory. My password and group file entries look
332 postfix:*:12345:12345:postfix:/no/where:/no/shell
337 Note: there should be no whitespace before "postfix:".
339 * Create a group "postdrop" with a group id that is not used by any other
340 user account. Not even by the postfix user account. My group file entry
346 Note: there should be no whitespace before "postdrop:".
348 6
\b6.
\b.3
\b3 -
\b- I
\bIn
\bns
\bst
\bta
\bal
\bll
\bl P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx
350 To install or upgrade Postfix from compiled source code, run one of the
351 following commands as the super-user:
353 # make install (interactive version, first time install)
355 # make upgrade (non-interactive version, for upgrades)
357 * The interactive version ("make install") asks for pathnames for Postfix
358 data and program files, and stores your preferences in the main.cf file. I
\bIf
\bf
359 y
\byo
\bou
\bu d
\bdo
\bon
\bn'
\b't
\bt w
\bwa
\ban
\bnt
\bt P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx t
\bto
\bo o
\bov
\bve
\ber
\brw
\bwr
\bri
\bit
\bte
\be n
\bno
\bon
\bn-
\b-P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx "
\b"s
\bse
\ben
\bnd
\bdm
\bma
\bai
\bil
\bl"
\b",
\b, "
\b"m
\bma
\bai
\bil
\blq
\bq"
\b" a
\ban
\bnd
\bd
360 "
\b"n
\bne
\bew
\bwa
\bal
\bli
\bia
\bas
\bse
\bes
\bs"
\b" f
\bfi
\bil
\ble
\bes
\bs,
\b, s
\bsp
\bpe
\bec
\bci
\bif
\bfy
\by p
\bpa
\bat
\bth
\bhn
\bna
\bam
\bme
\bes
\bs t
\bth
\bha
\bat
\bt e
\ben
\bnd
\bd i
\bin
\bn "
\b".
\b.p
\bpo
\bos
\bst
\btf
\bfi
\bix
\bx"
\b".
362 * The non-interactive version ("make upgrade") needs the /etc/postfix/main.cf
363 file from a previous installation. If the file does not exist, use
364 interactive installation ("make install") instead.
366 6
\b6.
\b.4
\b4 -
\b- C
\bCo
\bon
\bnf
\bfi
\big
\bgu
\bur
\bre
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx
368 Proceed to the section on how you wish to run Postfix on your particular
371 * Send mail only, without changing an existing Sendmail installation (section
374 * Send and receive mail via a virtual host interface, still without any
375 change to an existing Sendmail installation (section 8).
377 * Run Postfix instead of Sendmail (section 9).
379 7
\b7 -
\b- C
\bCo
\bon
\bnf
\bfi
\big
\bgu
\bur
\bri
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx t
\bto
\bo s
\bse
\ben
\bnd
\bd m
\bma
\bai
\bil
\bl o
\bon
\bnl
\bly
\by
381 If you are going to use Postfix to send mail only, there is no need to change
382 your existing sendmail setup. Instead, set up your mail user agent so that it
383 calls the Postfix sendmail program directly.
385 Follow the instructions in the "Mandatory configuration file edits" in section
386 10, and review the "To chroot or not to chroot" text in section 11.
388 You MUST comment out the "smtp inet" entry in /etc/postfix/master.cf, in order
389 to avoid conflicts with the real sendmail. Put a "#" character in front of the
390 line that defines the smtpd service:
392 /etc/postfix/master.cf:
393 #smtp inet n - n - - smtpd
395 Start the Postfix system:
399 or, if you feel nostalgic, use the Postfix sendmail command:
401 # sendmail -bd -qwhatever
403 and watch your maillog file for any error messages. The pathname is /var/log/
404 maillog, /var/log/mail, /var/log/syslog, or something else. Typically, the
405 pathname is defined in the /etc/syslog.conf file.
407 % egrep '(reject|warning|error|fatal|panic):' /some/log/file
409 Note: the most important error message is logged first. Later messages are not
412 In order to inspect the mail queue, use one of the following commands:
420 See also the "Care and feeding" section 12 below.
422 8
\b8 -
\b- C
\bCo
\bon
\bnf
\bfi
\big
\bgu
\bur
\bri
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx t
\bto
\bo s
\bse
\ben
\bnd
\bd a
\ban
\bnd
\bd r
\bre
\bec
\bce
\bei
\biv
\bve
\be m
\bma
\bai
\bil
\bl v
\bvi
\bia
\ba v
\bvi
\bir
\brt
\btu
\bua
\bal
\bl i
\bin
\bnt
\bte
\ber
\brf
\bfa
\bac
\bce
\be
424 Alternatively, you can use the Postfix system to send AND receive mail while
425 leaving your Sendmail setup intact, by running Postfix on a virtual interface
426 address. Simply configure your mail user agent to directly invoke the Postfix
429 To create a virtual network interface address, study your system ifconfig
430 manual page. The command syntax could be any of:
432 # i
\bif
\bfc
\bco
\bon
\bnf
\bfi
\big
\bg l
\ble
\be0
\b0:
\b:1
\b1 <
\b<a
\bad
\bdd
\bdr
\bre
\bes
\bss
\bs>
\b> n
\bne
\bet
\btm
\bma
\bas
\bsk
\bk <
\b<m
\bma
\bas
\bsk
\bk>
\b> u
\bup
\bp
433 # i
\bif
\bfc
\bco
\bon
\bnf
\bfi
\big
\bg e
\ben
\bn0
\b0 a
\bal
\bli
\bia
\bas
\bs <
\b<a
\bad
\bdd
\bdr
\bre
\bes
\bss
\bs>
\b> n
\bne
\bet
\btm
\bma
\bas
\bsk
\bk 2
\b25
\b55
\b5.
\b.2
\b25
\b55
\b5.
\b.2
\b25
\b55
\b5.
\b.2
\b25
\b55
\b5
435 In the /etc/postfix/main.cf file, I would specify
437 /etc/postfix/main.cf:
438 myhostname = virtual.host.tld
439 inet_interfaces = $myhostname
440 mydestination = $myhostname
442 Follow the instructions in the "Mandatory configuration file edits" in section
443 10, and review the "To chroot or not to chroot" text in section 11.
445 Start the Postfix system:
449 or, if you feel nostalgic, use the Postfix sendmail command:
451 # sendmail -bd -qwhatever
453 and watch your maillog file for any error messages. The pathname is /var/log/
454 maillog, /var/log/mail, /var/log/syslog, or something else. Typically, the
455 pathname is defined in the /etc/syslog.conf file.
457 % egrep '(reject|warning|error|fatal|panic):' /some/log/file
459 Note: the most important error message is logged first. Later messages are not
462 In order to inspect the mail queue, use one of the following commands:
470 See also the "Care and feeding" section 12 below.
472 9
\b9 -
\b- R
\bRu
\bun
\bnn
\bni
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx i
\bin
\bns
\bst
\bte
\bea
\bad
\bd o
\bof
\bf S
\bSe
\ben
\bnd
\bdm
\bma
\bai
\bil
\bl
474 Prior to installing Postfix you should save any existing sendmail program files
475 as described in section 6. Be sure to keep the old sendmail running for at
476 least a couple days to flush any unsent mail. To do so, stop the sendmail
477 daemon and restart it as:
479 # /usr/sbin/sendmail.OFF -q
481 Note: this is old sendmail syntax. Newer versions use separate processes for
482 mail submission and for running the queue.
484 After you have visited the "Mandatory configuration file edits" section below,
485 you can start the Postfix system with:
489 or, if you feel nostalgic, use the Postfix sendmail command:
491 # sendmail -bd -qwhatever
493 and watch your maillog file for any error messages. The pathname is /var/log/
494 maillog, /var/log/mail, /var/log/syslog, or something else. Typically, the
495 pathname is defined in the /etc/syslog.conf file.
497 % egrep '(reject|warning|error|fatal|panic):' /some/log/file
499 Note: the most important error message is logged first. Later messages are not
502 In order to inspect the mail queue, use one of the following commands:
510 See also the "Care and feeding" section 12 below.
512 1
\b10
\b0 -
\b- M
\bMa
\ban
\bnd
\bda
\bat
\bto
\bor
\bry
\by c
\bco
\bon
\bnf
\bfi
\big
\bgu
\bur
\bra
\bat
\bti
\bio
\bon
\bn f
\bfi
\bil
\ble
\be e
\bed
\bdi
\bit
\bts
\bs
514 Note: the material covered in this section is covered in more detail in the
515 BASIC_CONFIGURATION_README document. The information presented below is
516 targeted at experienced system administrators.
518 1
\b10
\b0.
\b.1
\b1 -
\b- P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx c
\bco
\bon
\bnf
\bfi
\big
\bgu
\bur
\bra
\bat
\bti
\bio
\bon
\bn f
\bfi
\bil
\ble
\bes
\bs
520 By default, Postfix configuration files are in /etc/postfix. The two most
521 important files are main.cf and master.cf; these files must be owned by root.
522 Giving someone else write permission to main.cf or master.cf (or to their
523 parent directories) means giving root privileges to that person.
525 In /etc/postfix/main.cf, you will have to set up a minimal number of
526 configuration parameters. Postfix configuration parameters resemble shell
527 variables, with two important differences: the first one is that Postfix does
528 not know about quotes like the UNIX shell does.
530 You specify a configuration parameter as:
532 /etc/postfix/main.cf:
535 and you use it by putting a "$" character in front of its name:
537 /etc/postfix/main.cf:
538 other_parameter = $parameter
540 You can use $parameter before it is given a value (that is the second main
541 difference with UNIX shell variables). The Postfix configuration language uses
542 lazy evaluation, and does not look at a parameter value until it is needed at
545 Whenever you make a change to the main.cf or master.cf file, execute the
546 following command in order to refresh a running mail system:
550 1
\b10
\b0.
\b.2
\b2 -
\b- D
\bDe
\bef
\bfa
\bau
\bul
\blt
\bt d
\bdo
\bom
\bma
\bai
\bin
\bn f
\bfo
\bor
\br u
\bun
\bnq
\bqu
\bua
\bal
\bli
\bif
\bfi
\bie
\bed
\bd a
\bad
\bdd
\bdr
\bre
\bes
\bss
\bse
\bes
\bs
552 First of all, you must specify what domain will be appended to an unqualified
553 address (i.e. an address without @domain.tld). The "myorigin" parameter
554 defaults to the local hostname, but that is probably OK only for very small
557 Some examples (use only one):
559 /etc/postfix/main.cf:
560 myorigin = $myhostname (send mail as "user@$myhostname")
561 myorigin = $mydomain (send mail as "user@$mydomain")
563 1
\b10
\b0.
\b.3
\b3 -
\b- W
\bWh
\bha
\bat
\bt d
\bdo
\bom
\bma
\bai
\bin
\bns
\bs t
\bto
\bo r
\bre
\bec
\bce
\bei
\biv
\bve
\be l
\blo
\boc
\bca
\bal
\bll
\bly
\by
565 Next you need to specify what mail addresses Postfix should deliver locally.
567 Some examples (use only one):
569 /etc/postfix/main.cf:
570 mydestination = $myhostname, localhost.$mydomain, localhost
571 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
572 mydestination = $myhostname
574 The first example is appropriate for a workstation, the second is appropriate
575 for the mailserver for an entire domain. The third example should be used when
576 running on a virtual host interface.
578 1
\b10
\b0.
\b.4
\b4 -
\b- P
\bPr
\bro
\box
\bxy
\by/
\b/N
\bNA
\bAT
\bT i
\bin
\bnt
\bte
\ber
\brf
\bfa
\bac
\bce
\be a
\bad
\bdd
\bdr
\bre
\bes
\bss
\bse
\bes
\bs
580 The proxy_interfaces parameter specifies all network addresses that Postfix
581 receives mail on by way of a proxy or network address translation unit. You may
582 specify symbolic hostnames instead of network addresses.
584 IMPORTANT: You must specify your proxy/NAT external addresses when your system
585 is a backup MX host for other domains, otherwise mail delivery loops will
586 happen when the primary MX host is down.
588 Example: host behind NAT box running a backup MX host.
590 /etc/postfix/main.cf:
591 proxy_interfaces = 1.2.3.4 (the proxy/NAT external network address)
593 1
\b10
\b0.
\b.5
\b5 -
\b- W
\bWh
\bha
\bat
\bt l
\blo
\boc
\bca
\bal
\bl c
\bcl
\bli
\bie
\ben
\bnt
\bts
\bs t
\bto
\bo r
\bre
\bel
\bla
\bay
\by m
\bma
\bai
\bil
\bl f
\bfr
\bro
\bom
\bm
595 If your machine is on an open network then you must specify what client IP
596 addresses are authorized to relay their mail through your machine into the
597 Internet. The default setting includes all subnetworks that the machine is
598 attached to. This may give relay permission to too many clients. My own
601 /etc/postfix/main.cf:
602 mynetworks = 168.100.189.0/28, 127.0.0.0/8
604 1
\b10
\b0.
\b.6
\b6 -
\b- W
\bWh
\bha
\bat
\bt r
\bre
\bel
\bla
\bay
\by d
\bde
\bes
\bst
\bti
\bin
\bna
\bat
\bti
\bio
\bon
\bns
\bs t
\bto
\bo a
\bac
\bcc
\bce
\bep
\bpt
\bt f
\bfr
\bro
\bom
\bm s
\bst
\btr
\bra
\ban
\bng
\bge
\ber
\brs
\bs
606 If your machine is on an open network then you must also specify whether
607 Postfix will forward mail from strangers. The default setting will forward mail
608 to all domains (and subdomains of) what is listed in $mydestination. This may
609 give relay permission for too many destinations. Recommended settings (use only
612 /etc/postfix/main.cf:
613 relay_domains = (do not forward mail from strangers)
614 relay_domains = $mydomain (my domain and subdomains)
615 relay_domains = $mydomain, other.domain.tld, ...
617 1
\b10
\b0.
\b.7
\b7 -
\b- O
\bOp
\bpt
\bti
\bio
\bon
\bna
\bal
\bl:
\b: c
\bco
\bon
\bnf
\bfi
\big
\bgu
\bur
\bre
\be a
\ba s
\bsm
\bma
\bar
\brt
\bt h
\bho
\bos
\bst
\bt f
\bfo
\bor
\br r
\bre
\bem
\bmo
\bot
\bte
\be d
\bde
\bel
\bli
\biv
\bve
\ber
\bry
\by
619 If you're behind a firewall, you should set up a relayhost. If you can, specify
620 the organizational domain name so that Postfix can use DNS lookups, and so that
621 it can fall back to a secondary MX host when the primary MX host is down.
622 Otherwise just specify a hard-coded hostname.
624 Some examples (use only one):
626 /etc/postfix/main.cf:
627 relayhost = $mydomain
628 relayhost = [mail.$mydomain]
630 The form enclosed with [] eliminates DNS MX lookups.
632 By default, the SMTP client will do DNS lookups even when you specify a relay
633 host. If your machine has no access to a DNS server, turn off SMTP client DNS
636 /etc/postfix/main.cf:
637 disable_dns_lookups = yes
639 The STANDARD_CONFIGURATION_README file has more hints and tips for firewalled
640 and/or dial-up networks.
642 1
\b10
\b0.
\b.8
\b8 -
\b- C
\bCr
\bre
\bea
\bat
\bte
\be t
\bth
\bhe
\be a
\bal
\bli
\bia
\bas
\bse
\bes
\bs d
\bda
\bat
\bta
\bab
\bba
\bas
\bse
\be
644 Postfix uses a Sendmail-compatible aliases(5) table to redirect mail for local
645 (8) recipients. Typically, this information is kept in two files: in a text
646 file /etc/aliases and in an indexed file /etc/aliases.db. The command "postconf
647 alias_maps" will tell you the exact location of the text file.
649 First, be sure to update the text file with aliases for root, postmaster and
650 "postfix" that forward mail to a real person. Postfix has a sample aliases file
651 /etc/postfix/aliases that you can adapt to local conditions.
660 Note: there should be no whitespace before the ":".
662 Finally, build the indexed aliases file with one of the following commands:
667 1
\b11
\b1 -
\b- T
\bTo
\bo c
\bch
\bhr
\bro
\boo
\bot
\bt o
\bor
\br n
\bno
\bot
\bt t
\bto
\bo c
\bch
\bhr
\bro
\boo
\bot
\bt
669 Postfix daemon processes can be configured (via master.cf) to run in a chroot
670 jail. The processes run at a fixed low privilege and with access only to the
671 Postfix queue directories (/var/spool/postfix). This provides a significant
672 barrier against intrusion. The barrier is not impenetrable, but every little
675 With the exception of Postfix daemons that deliver mail locally and/or that
676 execute non-Postfix commands, every Postfix daemon can run chrooted.
678 Sites with high security requirements should consider to chroot all daemons
679 that talk to the network: the smtp(8) and smtpd(8) processes, and perhaps also
680 the lmtp(8) client. The author's own porcupine.org mail server runs all daemons
681 chrooted that can be chrooted.
683 The default /etc/postfix/master.cf file specifies that no Postfix daemon runs
684 chrooted. In order to enable chroot operation, edit the file /etc/postfix/
685 master.cf. Instructions are in the file.
687 Note that a chrooted daemon resolves all filenames relative to the Postfix
688 queue directory (/var/spool/postfix). For successful use of a chroot jail, most
689 UNIX systems require you to bring in some files or device nodes. The examples/
690 chroot-setup directory in the source code distribution has a collection of
691 scripts that help you set up Postfix chroot environments on different operating
694 Additionally, you almost certainly need to configure syslogd so that it listens
695 on a socket inside the Postfix queue directory. Examples for specific systems:
699 # mkdir -p /var/spool/postfix/var/run
700 # syslogd -l /var/spool/postfix/var/run/log
704 # mkdir -p /var/spool/postfix/dev
705 # syslogd -a /var/spool/postfix/dev/log
707 1
\b12
\b2 -
\b- C
\bCa
\bar
\bre
\be a
\ban
\bnd
\bd f
\bfe
\bee
\bed
\bdi
\bin
\bng
\bg o
\bof
\bf t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx s
\bsy
\bys
\bst
\bte
\bem
\bm
709 Postfix daemon processes run in the background, and log problems and normal
710 activity to the syslog daemon. The names of logfiles are specified in /etc/
711 syslog.conf. At the very least you need something like:
714 mail.err /dev/console
715 mail.debug /var/log/maillog
717 IMPORTANT: the syslogd will not create files. You must create them before
718 (re)starting syslogd.
720 IMPORTANT: on Linux you need to put a "-" character before the pathname, e.g.,
721 -/var/log/maillog, otherwise the syslogd will use more system resources than
724 Hopefully, the number of problems will be small, but it is a good idea to run
725 every night before the syslog files are rotated:
728 # egrep '(reject|warning|error|fatal|panic):' /some/log/file
730 * The first line (postfix check) causes Postfix to report file permission/
731 ownership discrepancies.
733 * The second line looks for problem reports from the mail software, and
734 reports how effective the relay and junk mail access blocks are. This may
735 produce a lot of output. You will want to apply some postprocessing to
736 eliminate uninteresting information.
738 The DEBUG_README document describes the meaning of the "warning" etc. labels in