[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[0931098] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[d381c908] | 7 | <!-- editors: upstream postfix is ftp only, some of the mirrors offer
|
---|
| 8 | https - http://www.porcupine.org/mirmon/postfix-source.html lists the
|
---|
| 9 | mirror status, some of the mirrors shown as http are actually https -->
|
---|
| 10 | <!ENTITY postfix-download-http "https://ghostarchive.org/postfix/postfix-release/official/postfix-&postfix-version;.tar.gz">
|
---|
[e1e58be] | 11 | <!ENTITY postfix-download-ftp " ">
|
---|
[69e86505] | 12 | <!ENTITY postfix-md5sum "3eda9b945ed6cdf11ef58a731c574a04">
|
---|
| 13 | <!ENTITY postfix-size "4.7 MB">
|
---|
[d524862] | 14 | <!ENTITY postfix-buildsize "208 MB">
|
---|
[26ff6f1] | 15 | <!ENTITY postfix-time "0.1 SBU (Using parallelism=4)">
|
---|
[0931098] | 16 | ]>
|
---|
| 17 |
|
---|
[547df0bc] | 18 | <sect1 id="postfix" xreflabel="Postfix-&postfix-version;">
|
---|
[417f9e7] | 19 | <?dbhtml filename="postfix.html"?>
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | <title>Postfix-&postfix-version;</title>
|
---|
| 23 |
|
---|
| 24 | <indexterm zone="postfix">
|
---|
| 25 | <primary sortas="a-Postfix">Postfix</primary>
|
---|
| 26 | </indexterm>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="package">
|
---|
| 29 | <title>Introduction to Postfix</title>
|
---|
| 30 |
|
---|
[2605bb1] | 31 | <para>
|
---|
| 32 | The <application>Postfix</application> package contains a Mail Transport
|
---|
| 33 | Agent (MTA). This is useful for sending email to other users of your host
|
---|
| 34 | machine. It can also be configured to be a central mail server for your
|
---|
| 35 | domain, a mail relay agent or simply a mail delivery agent to your local
|
---|
| 36 | Internet Service Provider.
|
---|
| 37 | </para>
|
---|
[417f9e7] | 38 |
|
---|
[351881f] | 39 | &lfs122_checked;
|
---|
[438c11ab] | 40 |
|
---|
[417f9e7] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
[2605bb1] | 44 | <para>
|
---|
| 45 | Download (HTTP): <ulink url="&postfix-download-http;"/>
|
---|
| 46 | </para>
|
---|
[417f9e7] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[2605bb1] | 49 | <para>
|
---|
| 50 | Download (FTP): <ulink url="&postfix-download-ftp;"/>
|
---|
| 51 | </para>
|
---|
[417f9e7] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[2605bb1] | 54 | <para>
|
---|
| 55 | Download MD5 sum: &postfix-md5sum;
|
---|
| 56 | </para>
|
---|
[417f9e7] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[2605bb1] | 59 | <para>
|
---|
| 60 | Download size: &postfix-size;
|
---|
| 61 | </para>
|
---|
[417f9e7] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[2605bb1] | 64 | <para>
|
---|
| 65 | Estimated disk space required: &postfix-buildsize;
|
---|
| 66 | </para>
|
---|
[417f9e7] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[2605bb1] | 69 | <para>
|
---|
| 70 | Estimated build time: &postfix-time;
|
---|
| 71 | </para>
|
---|
[417f9e7] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[348ca51] | 74 | <!--
|
---|
[ddbaa48] | 75 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 76 | <itemizedlist spacing="compact">
|
---|
| 77 | <listitem>
|
---|
| 78 | <para>
|
---|
| 79 | Required patch:
|
---|
| 80 | <ulink url="&patch-root;/postfix-&postfix-version;-glibc230_fix-1.patch"/>
|
---|
| 81 | </para>
|
---|
| 82 | </listitem>
|
---|
| 83 | </itemizedlist>
|
---|
[348ca51] | 84 | -->
|
---|
[417f9e7] | 85 | <bridgehead renderas="sect3">Postfix Dependencies</bridgehead>
|
---|
| 86 |
|
---|
[58f0b91] | 87 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 88 | <para role="recommended">
|
---|
[90066bf] | 89 | <xref linkend="cyrus-sasl"/>,
|
---|
| 90 | <xref linkend="libnsl"/>, and
|
---|
| 91 | <xref linkend="lmdb"/>
|
---|
[58f0b91] | 92 | </para>
|
---|
| 93 |
|
---|
[417f9e7] | 94 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[438c11ab] | 95 | <para role="optional">
|
---|
[d9321c0] | 96 | <xref linkend="icu"/> for Email Address Internationalization (SMTPUTF8) support,
|
---|
[90fb8f6] | 97 | <xref linkend="mariadb"/> or <ulink url="https://www.mysql.com/">MySQL</ulink>,
|
---|
[58f0b91] | 98 | <xref linkend="openldap"/>,
|
---|
[39eac921] | 99 | <xref linkend="pcre2"/>,
|
---|
[58f0b91] | 100 | <xref linkend="postgresql"/>,
|
---|
[dcd5a063] | 101 | <xref linkend="sqlite"/>,
|
---|
| 102 | &berkeley-db;, and
|
---|
[90fb8f6] | 103 | <ulink url="https://cr.yp.to/cdb.html">CDB</ulink> or
|
---|
| 104 | <ulink url="https://www.corpit.ru/mjt/tinycdb.html">TinyCDB</ulink>
|
---|
[438c11ab] | 105 | </para>
|
---|
| 106 |
|
---|
[2605bb1] | 107 | <para>
|
---|
[58f0b91] | 108 | Note that <application>SQLite</application>,
|
---|
| 109 | <application>MySQL</application>, <application>PostgreSQL</application>
|
---|
| 110 | and <application>CDB</application> are only useful if there is a known
|
---|
[2605bb1] | 111 | need for them.
|
---|
| 112 | </para>
|
---|
[3cb0c57] | 113 |
|
---|
[2605bb1] | 114 | <para condition="html" role="usernotes">
|
---|
[42ddc30] | 115 | Editor Notes: <ulink url="&blfs-wiki;/postfix"/>
|
---|
[2605bb1] | 116 | </para>
|
---|
[417f9e7] | 117 | </sect2>
|
---|
| 118 |
|
---|
| 119 | <sect2 role="installation">
|
---|
| 120 | <title>Installation of Postfix</title>
|
---|
| 121 |
|
---|
[2605bb1] | 122 | <sect3>
|
---|
| 123 | <title>Adding Users and Groups</title>
|
---|
[58f0b91] | 124 |
|
---|
[2605bb1] | 125 | <para>
|
---|
| 126 | Before you compile the program, you need to create users and groups that
|
---|
| 127 | will be expected to be in place during the installation. Add the users
|
---|
| 128 | and groups with the following commands issued by the
|
---|
| 129 | <systemitem class="username">root</systemitem> user:
|
---|
| 130 | </para>
|
---|
| 131 |
|
---|
| 132 | <screen role="root"><userinput>groupadd -g 32 postfix &&
|
---|
| 133 | groupadd -g 33 postdrop &&
|
---|
[58f0b91] | 134 | useradd -c "Postfix Daemon User" -d /var/spool/postfix -g postfix \
|
---|
| 135 | -s /bin/false -u 32 postfix &&
|
---|
[2605bb1] | 136 | chown -v postfix:postfix /var/mail</userinput></screen>
|
---|
| 137 | </sect3>
|
---|
| 138 |
|
---|
[417f9e7] | 139 | <sect3>
|
---|
| 140 | <title>Configuring the Build</title>
|
---|
| 141 |
|
---|
[2605bb1] | 142 | <para>
|
---|
| 143 | The README files are formatted to be read with a pager like
|
---|
[e3d2ed3] | 144 | <application>less</application> or <application>more</application>.
|
---|
[b400d26] | 145 | If you want to use a text editor, make them legible with the
|
---|
| 146 | following sed:
|
---|
[2605bb1] | 147 | </para>
|
---|
| 148 |
|
---|
| 149 | <screen><userinput>sed -i 's/.\x08//g' README_FILES/*</userinput></screen>
|
---|
[4c59e83] | 150 |
|
---|
[2605bb1] | 151 | <para>
|
---|
| 152 | The <application>Postfix</application> source tree does not contain a
|
---|
| 153 | <filename>configure</filename> script, rather the makefile in the
|
---|
| 154 | top-level directory contains a <option>makefiles</option> target that
|
---|
| 155 | regenerates all the other makefiles in the build tree. If you wish to
|
---|
| 156 | use additional software such as a database back-end for virtual users,
|
---|
| 157 | or TLS/SSL authentication, you will need to regenerate the makefiles
|
---|
| 158 | using one or more of the appropriate <envar>CCARGS</envar> and
|
---|
| 159 | <envar>AUXLIBS</envar> settings listed below.
|
---|
| 160 | </para>
|
---|
| 161 |
|
---|
[d381c908] | 162 | <note>
|
---|
| 163 | <para>
|
---|
[351881f] | 164 | For all variants of the CCARGS you should ensure that '-DNO_NIS' is
|
---|
[90066bf] | 165 | specified so that the build does not attempt to access an rpcsvc
|
---|
[dcd5a063] | 166 | header which do not exist in BLFS. If &berkeley-db; is
|
---|
[351881f] | 167 | not installed, '-DNO_DB' needs to be specified as well.
|
---|
[d381c908] | 168 | </para>
|
---|
| 169 | </note>
|
---|
| 170 |
|
---|
[2605bb1] | 171 | <para>
|
---|
| 172 | For more details read the readme files.
|
---|
| 173 | </para>
|
---|
[ffdbde9c] | 174 |
|
---|
[69e86505] | 175 | <para>
|
---|
| 176 | Initialize the <envar>CCARGS</envar> and <envar>AUXLIBS</envar>
|
---|
| 177 | according to the note above:
|
---|
| 178 | </para>
|
---|
| 179 |
|
---|
[351881f] | 180 | <!-- This package does not accept a space between -D and the argument. -->
|
---|
| 181 |
|
---|
| 182 | <screen><userinput>CCARGS="-DNO_NIS -DNO_DB"
|
---|
[69e86505] | 183 | AUXLIBS=""</userinput></screen>
|
---|
| 184 |
|
---|
| 185 | <para>
|
---|
| 186 | Next, the <envar>CCARGS</envar> and the <envar>AUXLIBS</envar>
|
---|
| 187 | variables are filled with settings depending on the actual
|
---|
| 188 | system configuration. If an optional package is installed but
|
---|
| 189 | should <emphasis>not</emphasis> be included in the
|
---|
| 190 | <application>Postfix</application> build, simply skip the
|
---|
| 191 | corresponding <code>if [ ... ]; then</code> scriptlets.
|
---|
| 192 | </para>
|
---|
| 193 |
|
---|
[417f9e7] | 194 | <sect4>
|
---|
| 195 | <title>Cyrus-SASL</title>
|
---|
[3bfd1d6] | 196 |
|
---|
[2605bb1] | 197 | <para>
|
---|
| 198 | To use <application>Cyrus-SASL</application> with
|
---|
| 199 | <application>Postfix</application>, use the following arguments:
|
---|
| 200 | </para>
|
---|
[3bfd1d6] | 201 |
|
---|
[69e86505] | 202 | <screen><userinput>if [ -r /usr/lib/libsasl2.so ]; then
|
---|
[351881f] | 203 | CCARGS="$CCARGS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
|
---|
[69e86505] | 204 | AUXLIBS="$AUXLIBS -lsasl2"
|
---|
| 205 | fi</userinput></screen>
|
---|
[90066bf] | 206 | </sect4>
|
---|
| 207 |
|
---|
| 208 | <sect4>
|
---|
| 209 | <title>LMDB</title>
|
---|
| 210 | <para>
|
---|
| 211 | To use <application>LMDB</application> with
|
---|
| 212 | <application>Postfix</application>, use the following arguments:
|
---|
| 213 | </para>
|
---|
[58f0b91] | 214 |
|
---|
[69e86505] | 215 | <screen><userinput>if [ -r /usr/lib/liblmdb.so ]; then
|
---|
[351881f] | 216 | CCARGS="$CCARGS -DHAS_LMDB"
|
---|
[69e86505] | 217 | AUXLIBS="$AUXLIBS -llmdb"
|
---|
| 218 | fi</userinput></screen>
|
---|
[417f9e7] | 219 | </sect4>
|
---|
[3bfd1d6] | 220 |
|
---|
[417f9e7] | 221 | <sect4>
|
---|
| 222 | <title>OpenLDAP</title>
|
---|
[3bfd1d6] | 223 |
|
---|
[2605bb1] | 224 | <para>
|
---|
| 225 | To use <application>OpenLDAP</application> with
|
---|
| 226 | <application>Postfix</application>, use the following arguments:
|
---|
| 227 | </para>
|
---|
[3bfd1d6] | 228 |
|
---|
[69e86505] | 229 | <screen><userinput>if [ -r /usr/lib/libldap.so -a -r /usr/lib/liblber.so ]; then
|
---|
[351881f] | 230 | CCARGS="$CCARGS -DHAS_LDAP"
|
---|
[69e86505] | 231 | AUXLIBS="$AUXLIBS -lldap -llber"
|
---|
| 232 | fi</userinput></screen>
|
---|
[58f0b91] | 233 |
|
---|
[2605bb1] | 234 | </sect4>
|
---|
| 235 |
|
---|
| 236 | <sect4>
|
---|
| 237 | <title>Sqlite</title>
|
---|
| 238 |
|
---|
| 239 | <para>
|
---|
| 240 | To use <application>Sqlite</application> with
|
---|
| 241 | <application>Postfix</application>, use the following arguments:
|
---|
| 242 | </para>
|
---|
[3bfd1d6] | 243 |
|
---|
[69e86505] | 244 | <screen><userinput>if [ -r /usr/lib/libsqlite3.so ]; then
|
---|
[351881f] | 245 | CCARGS="$CCARGS -DHAS_SQLITE"
|
---|
[69e86505] | 246 | AUXLIBS="$AUXLIBS -lsqlite3 -lpthread"
|
---|
| 247 | fi</userinput></screen>
|
---|
[58f0b91] | 248 |
|
---|
[417f9e7] | 249 | </sect4>
|
---|
[3bfd1d6] | 250 |
|
---|
[417f9e7] | 251 | <sect4>
|
---|
| 252 | <title>MySQL</title>
|
---|
[0931098] | 253 |
|
---|
[2605bb1] | 254 | <para>
|
---|
| 255 | To use <application>MySQL</application> with
|
---|
| 256 | <application>Postfix</application>, use the following arguments:
|
---|
| 257 | </para>
|
---|
[417f9e7] | 258 |
|
---|
[69e86505] | 259 | <screen><userinput>if [ -r /usr/lib/libmysqlclient.so ]; then
|
---|
[351881f] | 260 | CCARGS="$CCARGS -DHAS_MYSQL -I/usr/include/mysql"
|
---|
[69e86505] | 261 | AUXLIBS="$AUXLIBS -lmysqlclient -lz -lm"
|
---|
| 262 | fi</userinput></screen>
|
---|
[58f0b91] | 263 |
|
---|
[417f9e7] | 264 | </sect4>
|
---|
| 265 |
|
---|
| 266 | <sect4>
|
---|
| 267 | <title>PostgreSQL</title>
|
---|
| 268 |
|
---|
[2605bb1] | 269 | <para>
|
---|
| 270 | To use <application>PostgreSQL</application> with
|
---|
| 271 | <application>Postfix</application>, use the following arguments:
|
---|
| 272 | </para>
|
---|
[417f9e7] | 273 |
|
---|
[69e86505] | 274 | <screen><userinput>if [ -r /usr/lib/libpq.so ]; then
|
---|
[351881f] | 275 | CCARGS="$CCARGS -DHAS_PGSQL -I/usr/include/postgresql"
|
---|
[69e86505] | 276 | AUXLIBS="$AUXLIBS -lpq -lz -lm"
|
---|
| 277 | fi</userinput></screen>
|
---|
[58f0b91] | 278 |
|
---|
[417f9e7] | 279 | </sect4>
|
---|
| 280 |
|
---|
[daeea03] | 281 | <sect4>
|
---|
[45cd2f9] | 282 | <title>CDB/TinyCDB</title>
|
---|
[daeea03] | 283 |
|
---|
[2605bb1] | 284 | <para>
|
---|
| 285 | To use <application>CDB</application> or
|
---|
| 286 | <application>TinyCDB</application> with
|
---|
| 287 | <application>Postfix</application>, use the following arguments:
|
---|
| 288 | </para>
|
---|
[daeea03] | 289 |
|
---|
[69e86505] | 290 | <screen><literal>if [ -r <replaceable></path/to/CDB></replaceable>/libcdb.a ]; then
|
---|
[351881f] | 291 | CCARGS="$CCARGS -DHAS_CDB"
|
---|
[69e86505] | 292 | AUXLIBS="$AUXLIBS <replaceable></path/to/CDB></replaceable>/libcdb.a"
|
---|
| 293 | fi</literal></screen>
|
---|
[58f0b91] | 294 |
|
---|
[45cd2f9] | 295 | </sect4>
|
---|
| 296 |
|
---|
| 297 | <sect4>
|
---|
| 298 | <title>StartTLS Authentication</title>
|
---|
| 299 |
|
---|
[2605bb1] | 300 | <para>
|
---|
| 301 | To use <application>OpenSSL</application> with
|
---|
| 302 | <application>Postfix</application>, use the following arguments:
|
---|
| 303 | </para>
|
---|
[45cd2f9] | 304 |
|
---|
[69e86505] | 305 | <screen><userinput>if [ -r /usr/lib/libssl.so -a -r /usr/lib/libcrypto.so ]; then
|
---|
[351881f] | 306 | CCARGS="$CCARGS -DUSE_TLS -I/usr/include/openssl/"
|
---|
[69e86505] | 307 | AUXLIBS="$AUXLIBS -lssl -lcrypto"
|
---|
| 308 | fi</userinput></screen>
|
---|
| 309 | <para>
|
---|
| 310 | <application>OpenSSL</application> is installed by LFS so it
|
---|
| 311 | should be always there. The <code>if ... then</code> is here
|
---|
| 312 | just for consistency.
|
---|
| 313 | </para>
|
---|
[daeea03] | 314 | </sect4>
|
---|
[58f0b91] | 315 |
|
---|
[417f9e7] | 316 | </sect3>
|
---|
| 317 |
|
---|
| 318 | <sect3>
|
---|
| 319 | <title>Installing Postfix</title>
|
---|
| 320 |
|
---|
[2605bb1] | 321 | <para>
|
---|
[69e86505] | 322 | There might be duplicate settings in <envar>AUXLIBS</envar>
|
---|
| 323 | like <code>-lm</code> when both, <application>MariaDB</application>
|
---|
| 324 | and <application>PostgreSQL</application> are used. They do
|
---|
| 325 | not harm. Install <application>Postfix</application> by
|
---|
| 326 | running the following commands:
|
---|
[2605bb1] | 327 | </para>
|
---|
[438c11ab] | 328 |
|
---|
[69e86505] | 329 | <screen><userinput>make CCARGS="$CCARGS" AUXLIBS="$AUXLIBS" makefiles &&
|
---|
[2605bb1] | 330 | make</userinput></screen>
|
---|
[0dfb754] | 331 |
|
---|
[48771ae] | 332 | <!-- There is a test suite, but it fails a lot. It seems to need
|
---|
[cef276c] | 333 | the host to be specifically setup for the tests.
|
---|
| 334 | Run with `make tests' and `make root_tests' -->
|
---|
[2605bb1] | 335 | <para>
|
---|
| 336 | This package does not come with a useful test suite.
|
---|
| 337 | </para>
|
---|
[0dfb754] | 338 |
|
---|
[2605bb1] | 339 | <para>
|
---|
| 340 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 341 | </para>
|
---|
[417f9e7] | 342 |
|
---|
[c9652d2] | 343 | <!-- dev note: sh postfix-install -non-interactive install_root=<DESTDIR> ... -->
|
---|
[2e8afa9] | 344 |
|
---|
[2605bb1] | 345 | <screen role="root"><userinput>sh postfix-install -non-interactive \
|
---|
[58f0b91] | 346 | daemon_directory=/usr/lib/postfix \
|
---|
| 347 | manpage_directory=/usr/share/man \
|
---|
| 348 | html_directory=/usr/share/doc/postfix-&postfix-version;/html \
|
---|
| 349 | readme_directory=/usr/share/doc/postfix-&postfix-version;/readme</userinput></screen>
|
---|
| 350 |
|
---|
[417f9e7] | 351 | </sect3>
|
---|
[58f0b91] | 352 |
|
---|
[417f9e7] | 353 | </sect2>
|
---|
[0931098] | 354 |
|
---|
[417f9e7] | 355 | <sect2 role="commands">
|
---|
| 356 | <title>Command Explanations</title>
|
---|
[0931098] | 357 |
|
---|
[2605bb1] | 358 | <para>
|
---|
| 359 | <command>make makefiles</command>: This command rebuilds the makefiles
|
---|
| 360 | throughout the source tree to use the options contained in the
|
---|
| 361 | <envar>CCARGS</envar> and <envar>AUXLIBS</envar> variables.
|
---|
| 362 | </para>
|
---|
[8568fa6] | 363 |
|
---|
[2605bb1] | 364 | <para>
|
---|
| 365 | <command>sh postfix-install -non-interactive</command>: This keeps the
|
---|
| 366 | install script from asking any questions, thereby accepting default
|
---|
| 367 | destination directories in all but the few cases. If the
|
---|
| 368 | <option>html_directory</option> and <option>readme_directory</option>
|
---|
| 369 | options are not set then the documentation will not be installed.
|
---|
| 370 | </para>
|
---|
[58f0b91] | 371 |
|
---|
[d9321c0] | 372 | <para>
|
---|
[351881f] | 373 | <option>CCARGS="-DNO_EAI ..."</option>: this will turn off SMTPUTF8
|
---|
[d9321c0] | 374 | support, for example if the rest of your email address infrastructure
|
---|
| 375 | cannot handle UTF-8 email addresses and message header values.
|
---|
| 376 | </para>
|
---|
| 377 |
|
---|
[417f9e7] | 378 | </sect2>
|
---|
[0931098] | 379 |
|
---|
[417f9e7] | 380 | <sect2 role="configuration">
|
---|
| 381 | <title>Configuring Postfix</title>
|
---|
[0931098] | 382 |
|
---|
[417f9e7] | 383 | <sect3 id="postfix-config">
|
---|
| 384 | <title>Config Files</title>
|
---|
[0931098] | 385 |
|
---|
[2605bb1] | 386 | <para>
|
---|
| 387 | <filename>/etc/aliases</filename>,
|
---|
| 388 | <filename>/etc/postfix/main.cf</filename>, and
|
---|
| 389 | <filename>/etc/postfix/master.cf</filename>
|
---|
| 390 | </para>
|
---|
[6c703f15] | 391 |
|
---|
[417f9e7] | 392 | <indexterm zone="postfix postfix-config">
|
---|
| 393 | <primary sortas="e-etc-aliases">/etc/aliases</primary>
|
---|
| 394 | </indexterm>
|
---|
[0931098] | 395 |
|
---|
[417f9e7] | 396 | <indexterm zone="postfix postfix-config">
|
---|
| 397 | <primary sortas="e-etc-postfix-star">/etc/postfix/*</primary>
|
---|
| 398 | </indexterm>
|
---|
| 399 |
|
---|
| 400 | </sect3>
|
---|
| 401 |
|
---|
| 402 | <sect3>
|
---|
| 403 | <title>Configuration Information</title>
|
---|
| 404 |
|
---|
[2605bb1] | 405 | <para>
|
---|
| 406 | Create (or append to an existing) <filename>/etc/aliases</filename>
|
---|
| 407 | with the following command. Change
|
---|
[85506b2] | 408 | <replaceable><LOGIN></replaceable> to your non-root login
|
---|
[2605bb1] | 409 | identity so mail addressed to
|
---|
| 410 | <systemitem class="username">root</systemitem> can be forwarded to you.
|
---|
| 411 | As the <systemitem class="username">root</systemitem> user:
|
---|
| 412 | </para>
|
---|
| 413 |
|
---|
[417f9e7] | 414 | <screen role="root"><userinput>cat >> /etc/aliases << "EOF"
|
---|
| 415 | <literal># Begin /etc/aliases
|
---|
[0931098] | 416 |
|
---|
| 417 | MAILER-DAEMON: postmaster
|
---|
| 418 | postmaster: root
|
---|
| 419 |
|
---|
[2605bb1] | 420 | root: <replaceable><LOGIN></replaceable>
|
---|
[417f9e7] | 421 | # End /etc/aliases</literal>
|
---|
| 422 | EOF</userinput></screen>
|
---|
| 423 |
|
---|
[2605bb1] | 424 | <para>
|
---|
| 425 | To protect an existing <filename>/etc/aliases</filename> file,
|
---|
[417f9e7] | 426 | the above command appends these aliases to it if it exists. This file
|
---|
[2605bb1] | 427 | should be checked and duplicate aliases removed, if present.
|
---|
| 428 | </para>
|
---|
| 429 |
|
---|
[90066bf] | 430 | <para>
|
---|
| 431 | The BLFS editors recommend to use LMDB instead of Berkeley DB for
|
---|
[99492e8e] | 432 | Postfix tables. Add three lines into
|
---|
[90066bf] | 433 | <filename>/etc/postfix/main.cf</filename> to make
|
---|
[99492e8e] | 434 | <command>postmap</command> encode the lookup tables in the LMDB
|
---|
| 435 | format by default and to change the default hash setting of the
|
---|
| 436 | alias tables:
|
---|
[90066bf] | 437 | </para>
|
---|
| 438 |
|
---|
[99492e8e] | 439 | <screen role="root"><userinput>echo 'default_database_type = lmdb' >> /etc/postfix/main.cf &&
|
---|
| 440 | echo 'alias_database = lmdb:/etc/aliases' >> /etc/postfix/main.cf &&
|
---|
| 441 | echo 'alias_maps = lmdb:/etc/aliases' >> /etc/postfix/main.cf</userinput></screen>
|
---|
[90066bf] | 442 |
|
---|
[d524862] | 443 | <para>
|
---|
| 444 | To protect your server against the recent SMTP smuggling attacks,
|
---|
[48ab76b] | 445 | additional steps are required. Add two lines into
|
---|
[fe1f174] | 446 | <filename>/etc/postfix/main.cf</filename> to disconnect remote SMTP
|
---|
[9f3382f] | 447 | clients that send bare newlines in the DATA section, while also
|
---|
| 448 | allowing clients on your network with non-standard SMTP implementations
|
---|
| 449 | to still send mail:
|
---|
[d524862] | 450 | </para>
|
---|
| 451 |
|
---|
[9f3382f] | 452 | <screen role="root"><userinput>echo 'smtpd_forbid_bare_newline = normalize' >> /etc/postfix/main.cf &&
|
---|
[d524862] | 453 | echo 'smtpd_forbid_bare_newline_exclusions = $mynetworks' >> /etc/postfix/main.cf</userinput></screen>
|
---|
| 454 |
|
---|
[90066bf] | 455 | <para>
|
---|
| 456 | Note that if you are following an online tutorial to configure
|
---|
| 457 | Postfix, the tutorial may refer to a lookup table with
|
---|
| 458 | <literal>hash:/path/to/lookup_table</literal>. You should replace
|
---|
| 459 | <literal>hash</literal> with <literal>lmdb</literal> in order to use
|
---|
| 460 | a lookup table encoded in the LMDB format.
|
---|
| 461 | </para>
|
---|
| 462 |
|
---|
[2605bb1] | 463 | <note>
|
---|
| 464 | <para>
|
---|
| 465 | The <filename>/etc/postfix/main.cf</filename> and
|
---|
| 466 | <filename>/etc/postfix/master.cf</filename> files must be personalized
|
---|
| 467 | for your system. The <filename>main.cf</filename> file needs your
|
---|
| 468 | fully qualified hostname. You will find that
|
---|
| 469 | <filename>main.cf</filename> is self documenting, so load it into your
|
---|
| 470 | editor to make the changes you need for your situation.
|
---|
| 471 | </para>
|
---|
[417f9e7] | 472 | </note>
|
---|
| 473 |
|
---|
[58f0b91] | 474 | <note>
|
---|
| 475 | <para>
|
---|
| 476 | <application>Postfix</application> can also be set up to
|
---|
[0d7900a] | 477 | run in a chroot jail. See the file in the source
|
---|
[58f0b91] | 478 | <filename>examples/chroot-setup/LINUX2</filename> for details.
|
---|
| 479 | </para>
|
---|
| 480 | </note>
|
---|
[3df190fb] | 481 |
|
---|
[f818fd6] | 482 | <para>
|
---|
| 483 | To ensure that all permissions are set properly, <application>postfix</application>
|
---|
| 484 | provides a tool which is to be run as the
|
---|
| 485 | <systemitem class="username">root</systemitem> user:
|
---|
| 486 | </para>
|
---|
| 487 |
|
---|
| 488 | <screen role="nodump"><userinput>/usr/sbin/postfix -c /etc/postfix set-permissions</userinput></screen>
|
---|
| 489 |
|
---|
[2605bb1] | 490 | <para>
|
---|
| 491 | If you have an existing configuration, you can run the
|
---|
| 492 | <command>postfix</command> utility to add any necessary definitions to
|
---|
| 493 | your existing files. As the
|
---|
| 494 | <systemitem class="username">root</systemitem> user:
|
---|
| 495 | </para>
|
---|
[cef276c] | 496 |
|
---|
[3fd97c4c] | 497 | <screen role="nodump"><userinput>/usr/sbin/postfix upgrade-configuration</userinput></screen>
|
---|
[cef276c] | 498 |
|
---|
[2605bb1] | 499 | <para>
|
---|
| 500 | Before starting <application>Postfix</application>, you should check
|
---|
| 501 | that your configuration and file permissions will work properly. Run the
|
---|
| 502 | following commands as the <systemitem class="username">root</systemitem>
|
---|
| 503 | user to check and start your <application>Postfix</application> server:
|
---|
| 504 | </para>
|
---|
[cef276c] | 505 |
|
---|
[3fd97c4c] | 506 | <screen role="nodump"><userinput>/usr/sbin/postfix check &&
|
---|
[417f9e7] | 507 | /usr/sbin/postfix start</userinput></screen>
|
---|
[58f0b91] | 508 |
|
---|
[417f9e7] | 509 | </sect3>
|
---|
| 510 |
|
---|
| 511 | <sect3 id="postfix-init">
|
---|
[1258125] | 512 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 513 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
[417f9e7] | 514 |
|
---|
[2605bb1] | 515 | <para>
|
---|
| 516 | To automate the running of Postfix at startup, install the
|
---|
[1258125] | 517 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/postfix</filename>
|
---|
| 518 | init script</phrase>
|
---|
| 519 | <phrase revision="systemd"><filename>postfix.service</filename>
|
---|
| 520 | unit</phrase> included in the
|
---|
| 521 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
[4472e923] | 522 | <xref linkend="systemd-units" revision="systemd"/> package:
|
---|
[2605bb1] | 523 | </para>
|
---|
[417f9e7] | 524 |
|
---|
| 525 | <indexterm zone="postfix postfix-init">
|
---|
| 526 | <primary sortas="f-postfix">postfix</primary>
|
---|
| 527 | </indexterm>
|
---|
| 528 |
|
---|
| 529 | <screen role="root"><userinput>make install-postfix</userinput></screen>
|
---|
[58f0b91] | 530 |
|
---|
[417f9e7] | 531 | </sect3>
|
---|
[58f0b91] | 532 |
|
---|
[417f9e7] | 533 | </sect2>
|
---|
| 534 |
|
---|
| 535 | <sect2 role="content">
|
---|
| 536 | <title>Contents</title>
|
---|
| 537 |
|
---|
| 538 | <segmentedlist>
|
---|
| 539 | <segtitle>Installed Programs</segtitle>
|
---|
[58f0b91] | 540 | <segtitle>Installed Libraries</segtitle>
|
---|
[417f9e7] | 541 | <segtitle>Installed Directories</segtitle>
|
---|
| 542 |
|
---|
| 543 | <seglistitem>
|
---|
[2605bb1] | 544 | <seg>
|
---|
[f13b771] | 545 | mailq (symlink), newaliases (symlink), postalias, postcat, postconf,
|
---|
| 546 | postdrop, postfix, postkick, postlock, postlog, postmap, postmulti,
|
---|
| 547 | postqueue, postsuper, and sendmail
|
---|
[58f0b91] | 548 | </seg>
|
---|
| 549 | <seg>
|
---|
| 550 | None
|
---|
[2605bb1] | 551 | </seg>
|
---|
| 552 | <seg>
|
---|
[0a76c13] | 553 | /{etc,usr/lib}/postfix,
|
---|
| 554 | /usr/share/doc/postfix-&postfix-version; and
|
---|
| 555 | /var/{lib,spool}/postfix
|
---|
[2605bb1] | 556 | </seg>
|
---|
[417f9e7] | 557 | </seglistitem>
|
---|
| 558 | </segmentedlist>
|
---|
| 559 |
|
---|
| 560 | <variablelist>
|
---|
| 561 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 562 | <?dbfo list-presentation="list"?>
|
---|
| 563 | <?dbhtml list-presentation="table"?>
|
---|
| 564 |
|
---|
| 565 | <varlistentry id="mailq">
|
---|
| 566 | <term><command>mailq</command></term>
|
---|
| 567 | <listitem>
|
---|
[2605bb1] | 568 | <para>
|
---|
[4c24eb0a] | 569 | A symlink to <filename>sendmail</filename>
|
---|
[2605bb1] | 570 | </para>
|
---|
[417f9e7] | 571 | <indexterm zone="postfix mailq">
|
---|
| 572 | <primary sortas="b-mailq">mailq</primary>
|
---|
| 573 | </indexterm>
|
---|
| 574 | </listitem>
|
---|
| 575 | </varlistentry>
|
---|
| 576 |
|
---|
| 577 | <varlistentry id="newaliases">
|
---|
| 578 | <term><command>newaliases</command></term>
|
---|
| 579 | <listitem>
|
---|
[2605bb1] | 580 | <para>
|
---|
[4c24eb0a] | 581 | A symlink to <filename>sendmail</filename>
|
---|
[2605bb1] | 582 | </para>
|
---|
[417f9e7] | 583 | <indexterm zone="postfix newaliases">
|
---|
| 584 | <primary sortas="b-newaliases">newaliases</primary>
|
---|
| 585 | </indexterm>
|
---|
| 586 | </listitem>
|
---|
| 587 | </varlistentry>
|
---|
| 588 |
|
---|
[2e8afa9] | 589 | <varlistentry id="postalias">
|
---|
| 590 | <term><command>postalias</command></term>
|
---|
[417f9e7] | 591 | <listitem>
|
---|
[2605bb1] | 592 | <para>
|
---|
| 593 | is a utility for <application>Postfix</application> alias database
|
---|
| 594 | maintenance
|
---|
| 595 | </para>
|
---|
[2e8afa9] | 596 | <indexterm zone="postfix postalias">
|
---|
| 597 | <primary sortas="b-postalias">postalias</primary>
|
---|
[417f9e7] | 598 | </indexterm>
|
---|
| 599 | </listitem>
|
---|
| 600 | </varlistentry>
|
---|
| 601 |
|
---|
| 602 | <varlistentry id="postcat">
|
---|
| 603 | <term><command>postcat</command></term>
|
---|
| 604 | <listitem>
|
---|
[2605bb1] | 605 | <para>
|
---|
| 606 | Prints the contents of files from the
|
---|
[4c24eb0a] | 607 | <application>Postfix</application> queue in human readable format
|
---|
[2605bb1] | 608 | </para>
|
---|
[417f9e7] | 609 | <indexterm zone="postfix postcat">
|
---|
| 610 | <primary sortas="b-postcat">postcat</primary>
|
---|
| 611 | </indexterm>
|
---|
| 612 | </listitem>
|
---|
| 613 | </varlistentry>
|
---|
| 614 |
|
---|
| 615 | <varlistentry id="postconf">
|
---|
| 616 | <term><command>postconf</command></term>
|
---|
| 617 | <listitem>
|
---|
[2605bb1] | 618 | <para>
|
---|
| 619 | Displays or changes the value of
|
---|
[4c24eb0a] | 620 | <application>Postfix</application> configuration parameters
|
---|
[2605bb1] | 621 | </para>
|
---|
[417f9e7] | 622 | <indexterm zone="postfix postconf">
|
---|
| 623 | <primary sortas="b-postconf">postconf</primary>
|
---|
| 624 | </indexterm>
|
---|
| 625 | </listitem>
|
---|
| 626 | </varlistentry>
|
---|
| 627 |
|
---|
| 628 | <varlistentry id="postdrop">
|
---|
| 629 | <term><command>postdrop</command></term>
|
---|
| 630 | <listitem>
|
---|
[2605bb1] | 631 | <para>
|
---|
| 632 | Creates a file in the maildrop directory and copies its standard
|
---|
[4c24eb0a] | 633 | input to the file
|
---|
[2605bb1] | 634 | </para>
|
---|
[417f9e7] | 635 | <indexterm zone="postfix postdrop">
|
---|
| 636 | <primary sortas="b-postdrop">postdrop</primary>
|
---|
| 637 | </indexterm>
|
---|
| 638 | </listitem>
|
---|
| 639 | </varlistentry>
|
---|
| 640 |
|
---|
| 641 | <varlistentry id="postfix-bin">
|
---|
| 642 | <term><command>postfix</command></term>
|
---|
| 643 | <listitem>
|
---|
[2605bb1] | 644 | <para>
|
---|
[4c24eb0a] | 645 | is the <application>Postfix</application> control program
|
---|
[2605bb1] | 646 | </para>
|
---|
[417f9e7] | 647 | <indexterm zone="postfix postfix-bin">
|
---|
| 648 | <primary sortas="b-postfix">postfix</primary>
|
---|
| 649 | </indexterm>
|
---|
| 650 | </listitem>
|
---|
| 651 | </varlistentry>
|
---|
| 652 |
|
---|
| 653 | <varlistentry id="postkick">
|
---|
| 654 | <term><command>postkick</command></term>
|
---|
| 655 | <listitem>
|
---|
[2605bb1] | 656 | <para>
|
---|
| 657 | Sends requests to the specified service over a local transport
|
---|
[4c24eb0a] | 658 | channel
|
---|
[2605bb1] | 659 | </para>
|
---|
[417f9e7] | 660 | <indexterm zone="postfix postkick">
|
---|
| 661 | <primary sortas="b-postkick">postkick</primary>
|
---|
| 662 | </indexterm>
|
---|
| 663 | </listitem>
|
---|
| 664 | </varlistentry>
|
---|
| 665 |
|
---|
| 666 | <varlistentry id="postlock">
|
---|
| 667 | <term><command>postlock</command></term>
|
---|
| 668 | <listitem>
|
---|
[2605bb1] | 669 | <para>
|
---|
| 670 | Locks a mail folder for exclusive use, and executes commands passed
|
---|
[4c24eb0a] | 671 | to it
|
---|
[2605bb1] | 672 | </para>
|
---|
[417f9e7] | 673 | <indexterm zone="postfix postlock">
|
---|
| 674 | <primary sortas="b-postlock">postlock</primary>
|
---|
| 675 | </indexterm>
|
---|
| 676 | </listitem>
|
---|
| 677 | </varlistentry>
|
---|
| 678 |
|
---|
| 679 | <varlistentry id="postlog">
|
---|
| 680 | <term><command>postlog</command></term>
|
---|
| 681 | <listitem>
|
---|
[2605bb1] | 682 | <para>
|
---|
| 683 | A <application>Postfix</application>-compatible logging interface
|
---|
[4c24eb0a] | 684 | for use in, for example, shell scripts
|
---|
[2605bb1] | 685 | </para>
|
---|
[417f9e7] | 686 | <indexterm zone="postfix postlog">
|
---|
| 687 | <primary sortas="b-postlog">postlog</primary>
|
---|
| 688 | </indexterm>
|
---|
| 689 | </listitem>
|
---|
| 690 | </varlistentry>
|
---|
| 691 |
|
---|
| 692 | <varlistentry id="postmap">
|
---|
| 693 | <term><command>postmap</command></term>
|
---|
| 694 | <listitem>
|
---|
[2605bb1] | 695 | <para>
|
---|
| 696 | Creates or queries one or more Postfix lookup tables, or updates an
|
---|
[4c24eb0a] | 697 | existing one
|
---|
[2605bb1] | 698 | </para>
|
---|
[417f9e7] | 699 | <indexterm zone="postfix postmap">
|
---|
| 700 | <primary sortas="b-postmap">postmap</primary>
|
---|
| 701 | </indexterm>
|
---|
| 702 | </listitem>
|
---|
| 703 | </varlistentry>
|
---|
| 704 |
|
---|
[2605bb1] | 705 | <varlistentry id="postmulti">
|
---|
| 706 | <term><command>postmulti</command></term>
|
---|
| 707 | <listitem>
|
---|
| 708 | <para>
|
---|
| 709 | is the <application>Postfix</application> multi-instance manager.
|
---|
| 710 | It allows a system administrator to manage multiple
|
---|
[4c24eb0a] | 711 | <application>Postfix</application> instances on a single host
|
---|
[2605bb1] | 712 | </para>
|
---|
| 713 | <indexterm zone="postfix postmulti">
|
---|
| 714 | <primary sortas="b-postmulti">postmulti</primary>
|
---|
| 715 | </indexterm>
|
---|
| 716 | </listitem>
|
---|
| 717 | </varlistentry>
|
---|
| 718 |
|
---|
[417f9e7] | 719 | <varlistentry id="postqueue">
|
---|
| 720 | <term><command>postqueue</command></term>
|
---|
| 721 | <listitem>
|
---|
[2605bb1] | 722 | <para>
|
---|
[58f0b91] | 723 | The <application>Postfix</application> user interface for
|
---|
[4c24eb0a] | 724 | queue management
|
---|
[58f0b91] | 725 | </para>
|
---|
[417f9e7] | 726 | <indexterm zone="postfix postqueue">
|
---|
| 727 | <primary sortas="b-postqueue">postqueue</primary>
|
---|
| 728 | </indexterm>
|
---|
| 729 | </listitem>
|
---|
| 730 | </varlistentry>
|
---|
| 731 |
|
---|
| 732 | <varlistentry id="postsuper">
|
---|
| 733 | <term><command>postsuper</command></term>
|
---|
| 734 | <listitem>
|
---|
[2605bb1] | 735 | <para>
|
---|
[58f0b91] | 736 | The <application>Postfix</application> user interface for
|
---|
[4c24eb0a] | 737 | superuser queue management
|
---|
[58f0b91] | 738 | </para>
|
---|
[417f9e7] | 739 | <indexterm zone="postfix postsuper">
|
---|
| 740 | <primary sortas="b-postsuper">postsuper</primary>
|
---|
| 741 | </indexterm>
|
---|
| 742 | </listitem>
|
---|
| 743 | </varlistentry>
|
---|
| 744 |
|
---|
| 745 | <varlistentry id="sendmail-postfix">
|
---|
| 746 | <term><command>sendmail</command></term>
|
---|
| 747 | <listitem>
|
---|
[2605bb1] | 748 | <para>
|
---|
| 749 | is the <application>Postfix</application> to
|
---|
[4c24eb0a] | 750 | <application>Sendmail</application> compatibility interface
|
---|
[2605bb1] | 751 | </para>
|
---|
[417f9e7] | 752 | <indexterm zone="postfix sendmail-postfix">
|
---|
| 753 | <primary sortas="b-sendmail">sendmail</primary>
|
---|
| 754 | </indexterm>
|
---|
| 755 | </listitem>
|
---|
| 756 | </varlistentry>
|
---|
[58f0b91] | 757 |
|
---|
[417f9e7] | 758 | </variablelist>
|
---|
[58f0b91] | 759 |
|
---|
[417f9e7] | 760 | </sect2>
|
---|
[58f0b91] | 761 |
|
---|
[f45b1953] | 762 | </sect1>
|
---|