[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 |
|
---|
[062c7122] | 39 | &lfs121_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>
|
---|
[4304a5f] | 164 | For all variants of the CCARGS you should ensure that '-D NO_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
|
---|
[4304a5f] | 167 | not installed, '-D NO_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 |
|
---|
[4304a5f] | 180 | <screen><userinput>CCARGS="-D NO_NIS -D NO_DB"
|
---|
[69e86505] | 181 | AUXLIBS=""</userinput></screen>
|
---|
| 182 |
|
---|
| 183 | <para>
|
---|
| 184 | Next, the <envar>CCARGS</envar> and the <envar>AUXLIBS</envar>
|
---|
| 185 | variables are filled with settings depending on the actual
|
---|
| 186 | system configuration. If an optional package is installed but
|
---|
| 187 | should <emphasis>not</emphasis> be included in the
|
---|
| 188 | <application>Postfix</application> build, simply skip the
|
---|
| 189 | corresponding <code>if [ ... ]; then</code> scriptlets.
|
---|
| 190 | </para>
|
---|
| 191 |
|
---|
[417f9e7] | 192 | <sect4>
|
---|
| 193 | <title>Cyrus-SASL</title>
|
---|
[3bfd1d6] | 194 |
|
---|
[2605bb1] | 195 | <para>
|
---|
| 196 | To use <application>Cyrus-SASL</application> with
|
---|
| 197 | <application>Postfix</application>, use the following arguments:
|
---|
| 198 | </para>
|
---|
[3bfd1d6] | 199 |
|
---|
[69e86505] | 200 | <screen><userinput>if [ -r /usr/lib/libsasl2.so ]; then
|
---|
[4304a5f] | 201 | CCARGS="$CCARGS -D USE_SASL_AUTH -D USE_CYRUS_SASL -I/usr/include/sasl"
|
---|
[69e86505] | 202 | AUXLIBS="$AUXLIBS -lsasl2"
|
---|
| 203 | fi</userinput></screen>
|
---|
[90066bf] | 204 | </sect4>
|
---|
| 205 |
|
---|
| 206 | <sect4>
|
---|
| 207 | <title>LMDB</title>
|
---|
| 208 | <para>
|
---|
| 209 | To use <application>LMDB</application> with
|
---|
| 210 | <application>Postfix</application>, use the following arguments:
|
---|
| 211 | </para>
|
---|
[58f0b91] | 212 |
|
---|
[69e86505] | 213 | <screen><userinput>if [ -r /usr/lib/liblmdb.so ]; then
|
---|
[4304a5f] | 214 | CCARGS="$CCARGS -D HAS_LMDB"
|
---|
[69e86505] | 215 | AUXLIBS="$AUXLIBS -llmdb"
|
---|
| 216 | fi</userinput></screen>
|
---|
[417f9e7] | 217 | </sect4>
|
---|
[3bfd1d6] | 218 |
|
---|
[417f9e7] | 219 | <sect4>
|
---|
| 220 | <title>OpenLDAP</title>
|
---|
[3bfd1d6] | 221 |
|
---|
[2605bb1] | 222 | <para>
|
---|
| 223 | To use <application>OpenLDAP</application> with
|
---|
| 224 | <application>Postfix</application>, use the following arguments:
|
---|
| 225 | </para>
|
---|
[3bfd1d6] | 226 |
|
---|
[69e86505] | 227 | <screen><userinput>if [ -r /usr/lib/libldap.so -a -r /usr/lib/liblber.so ]; then
|
---|
[4304a5f] | 228 | CCARGS="$CCARGS -D HAS_LDAP"
|
---|
[69e86505] | 229 | AUXLIBS="$AUXLIBS -lldap -llber"
|
---|
| 230 | fi</userinput></screen>
|
---|
[58f0b91] | 231 |
|
---|
[2605bb1] | 232 | </sect4>
|
---|
| 233 |
|
---|
| 234 | <sect4>
|
---|
| 235 | <title>Sqlite</title>
|
---|
| 236 |
|
---|
| 237 | <para>
|
---|
| 238 | To use <application>Sqlite</application> with
|
---|
| 239 | <application>Postfix</application>, use the following arguments:
|
---|
| 240 | </para>
|
---|
[3bfd1d6] | 241 |
|
---|
[69e86505] | 242 | <screen><userinput>if [ -r /usr/lib/libsqlite3.so ]; then
|
---|
[4304a5f] | 243 | CCARGS="$CCARGS -D HAS_SQLITE"
|
---|
[69e86505] | 244 | AUXLIBS="$AUXLIBS -lsqlite3 -lpthread"
|
---|
| 245 | fi</userinput></screen>
|
---|
[58f0b91] | 246 |
|
---|
[417f9e7] | 247 | </sect4>
|
---|
[3bfd1d6] | 248 |
|
---|
[417f9e7] | 249 | <sect4>
|
---|
| 250 | <title>MySQL</title>
|
---|
[0931098] | 251 |
|
---|
[2605bb1] | 252 | <para>
|
---|
| 253 | To use <application>MySQL</application> with
|
---|
| 254 | <application>Postfix</application>, use the following arguments:
|
---|
| 255 | </para>
|
---|
[417f9e7] | 256 |
|
---|
[69e86505] | 257 | <screen><userinput>if [ -r /usr/lib/libmysqlclient.so ]; then
|
---|
[4304a5f] | 258 | CCARGS="$CCARGS -D HAS_MYSQL -I/usr/include/mysql"
|
---|
[69e86505] | 259 | AUXLIBS="$AUXLIBS -lmysqlclient -lz -lm"
|
---|
| 260 | fi</userinput></screen>
|
---|
[58f0b91] | 261 |
|
---|
[417f9e7] | 262 | </sect4>
|
---|
| 263 |
|
---|
| 264 | <sect4>
|
---|
| 265 | <title>PostgreSQL</title>
|
---|
| 266 |
|
---|
[2605bb1] | 267 | <para>
|
---|
| 268 | To use <application>PostgreSQL</application> with
|
---|
| 269 | <application>Postfix</application>, use the following arguments:
|
---|
| 270 | </para>
|
---|
[417f9e7] | 271 |
|
---|
[69e86505] | 272 | <screen><userinput>if [ -r /usr/lib/libpq.so ]; then
|
---|
[4304a5f] | 273 | CCARGS="$CCARGS -D HAS_PGSQL -I/usr/include/postgresql"
|
---|
[69e86505] | 274 | AUXLIBS="$AUXLIBS -lpq -lz -lm"
|
---|
| 275 | fi</userinput></screen>
|
---|
[58f0b91] | 276 |
|
---|
[417f9e7] | 277 | </sect4>
|
---|
| 278 |
|
---|
[daeea03] | 279 | <sect4>
|
---|
[45cd2f9] | 280 | <title>CDB/TinyCDB</title>
|
---|
[daeea03] | 281 |
|
---|
[2605bb1] | 282 | <para>
|
---|
| 283 | To use <application>CDB</application> or
|
---|
| 284 | <application>TinyCDB</application> with
|
---|
| 285 | <application>Postfix</application>, use the following arguments:
|
---|
| 286 | </para>
|
---|
[daeea03] | 287 |
|
---|
[69e86505] | 288 | <screen><literal>if [ -r <replaceable></path/to/CDB></replaceable>/libcdb.a ]; then
|
---|
[4304a5f] | 289 | CCARGS="$CCARGS -D HAS_CDB"
|
---|
[69e86505] | 290 | AUXLIBS="$AUXLIBS <replaceable></path/to/CDB></replaceable>/libcdb.a"
|
---|
| 291 | fi</literal></screen>
|
---|
[58f0b91] | 292 |
|
---|
[45cd2f9] | 293 | </sect4>
|
---|
| 294 |
|
---|
| 295 | <sect4>
|
---|
| 296 | <title>StartTLS Authentication</title>
|
---|
| 297 |
|
---|
[2605bb1] | 298 | <para>
|
---|
| 299 | To use <application>OpenSSL</application> with
|
---|
| 300 | <application>Postfix</application>, use the following arguments:
|
---|
| 301 | </para>
|
---|
[45cd2f9] | 302 |
|
---|
[69e86505] | 303 | <screen><userinput>if [ -r /usr/lib/libssl.so -a -r /usr/lib/libcrypto.so ]; then
|
---|
[4304a5f] | 304 | CCARGS="$CCARGS -D USE_TLS -I/usr/include/openssl/"
|
---|
[69e86505] | 305 | AUXLIBS="$AUXLIBS -lssl -lcrypto"
|
---|
| 306 | fi</userinput></screen>
|
---|
| 307 | <para>
|
---|
| 308 | <application>OpenSSL</application> is installed by LFS so it
|
---|
| 309 | should be always there. The <code>if ... then</code> is here
|
---|
| 310 | just for consistency.
|
---|
| 311 | </para>
|
---|
[daeea03] | 312 | </sect4>
|
---|
[58f0b91] | 313 |
|
---|
[417f9e7] | 314 | </sect3>
|
---|
| 315 |
|
---|
| 316 | <sect3>
|
---|
| 317 | <title>Installing Postfix</title>
|
---|
| 318 |
|
---|
[2605bb1] | 319 | <para>
|
---|
[69e86505] | 320 | There might be duplicate settings in <envar>AUXLIBS</envar>
|
---|
| 321 | like <code>-lm</code> when both, <application>MariaDB</application>
|
---|
| 322 | and <application>PostgreSQL</application> are used. They do
|
---|
| 323 | not harm. Install <application>Postfix</application> by
|
---|
| 324 | running the following commands:
|
---|
[2605bb1] | 325 | </para>
|
---|
[438c11ab] | 326 |
|
---|
[69e86505] | 327 | <screen><userinput>make CCARGS="$CCARGS" AUXLIBS="$AUXLIBS" makefiles &&
|
---|
[2605bb1] | 328 | make</userinput></screen>
|
---|
[0dfb754] | 329 |
|
---|
[48771ae] | 330 | <!-- There is a test suite, but it fails a lot. It seems to need
|
---|
[cef276c] | 331 | the host to be specifically setup for the tests.
|
---|
| 332 | Run with `make tests' and `make root_tests' -->
|
---|
[2605bb1] | 333 | <para>
|
---|
| 334 | This package does not come with a useful test suite.
|
---|
| 335 | </para>
|
---|
[0dfb754] | 336 |
|
---|
[2605bb1] | 337 | <para>
|
---|
| 338 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 339 | </para>
|
---|
[417f9e7] | 340 |
|
---|
[c9652d2] | 341 | <!-- dev note: sh postfix-install -non-interactive install_root=<DESTDIR> ... -->
|
---|
[2e8afa9] | 342 |
|
---|
[2605bb1] | 343 | <screen role="root"><userinput>sh postfix-install -non-interactive \
|
---|
[58f0b91] | 344 | daemon_directory=/usr/lib/postfix \
|
---|
| 345 | manpage_directory=/usr/share/man \
|
---|
| 346 | html_directory=/usr/share/doc/postfix-&postfix-version;/html \
|
---|
| 347 | readme_directory=/usr/share/doc/postfix-&postfix-version;/readme</userinput></screen>
|
---|
| 348 |
|
---|
[417f9e7] | 349 | </sect3>
|
---|
[58f0b91] | 350 |
|
---|
[417f9e7] | 351 | </sect2>
|
---|
[0931098] | 352 |
|
---|
[417f9e7] | 353 | <sect2 role="commands">
|
---|
| 354 | <title>Command Explanations</title>
|
---|
[0931098] | 355 |
|
---|
[2605bb1] | 356 | <para>
|
---|
| 357 | <command>make makefiles</command>: This command rebuilds the makefiles
|
---|
| 358 | throughout the source tree to use the options contained in the
|
---|
| 359 | <envar>CCARGS</envar> and <envar>AUXLIBS</envar> variables.
|
---|
| 360 | </para>
|
---|
[8568fa6] | 361 |
|
---|
[2605bb1] | 362 | <para>
|
---|
| 363 | <command>sh postfix-install -non-interactive</command>: This keeps the
|
---|
| 364 | install script from asking any questions, thereby accepting default
|
---|
| 365 | destination directories in all but the few cases. If the
|
---|
| 366 | <option>html_directory</option> and <option>readme_directory</option>
|
---|
| 367 | options are not set then the documentation will not be installed.
|
---|
| 368 | </para>
|
---|
[58f0b91] | 369 |
|
---|
[d9321c0] | 370 | <para>
|
---|
[4304a5f] | 371 | <option>CCARGS="-D NO_EAI ..."</option>: this will turn off SMTPUTF8
|
---|
[d9321c0] | 372 | support, for example if the rest of your email address infrastructure
|
---|
| 373 | cannot handle UTF-8 email addresses and message header values.
|
---|
| 374 | </para>
|
---|
| 375 |
|
---|
[417f9e7] | 376 | </sect2>
|
---|
[0931098] | 377 |
|
---|
[417f9e7] | 378 | <sect2 role="configuration">
|
---|
| 379 | <title>Configuring Postfix</title>
|
---|
[0931098] | 380 |
|
---|
[417f9e7] | 381 | <sect3 id="postfix-config">
|
---|
| 382 | <title>Config Files</title>
|
---|
[0931098] | 383 |
|
---|
[2605bb1] | 384 | <para>
|
---|
| 385 | <filename>/etc/aliases</filename>,
|
---|
| 386 | <filename>/etc/postfix/main.cf</filename>, and
|
---|
| 387 | <filename>/etc/postfix/master.cf</filename>
|
---|
| 388 | </para>
|
---|
[6c703f15] | 389 |
|
---|
[417f9e7] | 390 | <indexterm zone="postfix postfix-config">
|
---|
| 391 | <primary sortas="e-etc-aliases">/etc/aliases</primary>
|
---|
| 392 | </indexterm>
|
---|
[0931098] | 393 |
|
---|
[417f9e7] | 394 | <indexterm zone="postfix postfix-config">
|
---|
| 395 | <primary sortas="e-etc-postfix-star">/etc/postfix/*</primary>
|
---|
| 396 | </indexterm>
|
---|
| 397 |
|
---|
| 398 | </sect3>
|
---|
| 399 |
|
---|
| 400 | <sect3>
|
---|
| 401 | <title>Configuration Information</title>
|
---|
| 402 |
|
---|
[2605bb1] | 403 | <para>
|
---|
| 404 | Create (or append to an existing) <filename>/etc/aliases</filename>
|
---|
| 405 | with the following command. Change
|
---|
[85506b2] | 406 | <replaceable><LOGIN></replaceable> to your non-root login
|
---|
[2605bb1] | 407 | identity so mail addressed to
|
---|
| 408 | <systemitem class="username">root</systemitem> can be forwarded to you.
|
---|
| 409 | As the <systemitem class="username">root</systemitem> user:
|
---|
| 410 | </para>
|
---|
| 411 |
|
---|
[417f9e7] | 412 | <screen role="root"><userinput>cat >> /etc/aliases << "EOF"
|
---|
| 413 | <literal># Begin /etc/aliases
|
---|
[0931098] | 414 |
|
---|
| 415 | MAILER-DAEMON: postmaster
|
---|
| 416 | postmaster: root
|
---|
| 417 |
|
---|
[2605bb1] | 418 | root: <replaceable><LOGIN></replaceable>
|
---|
[417f9e7] | 419 | # End /etc/aliases</literal>
|
---|
| 420 | EOF</userinput></screen>
|
---|
| 421 |
|
---|
[2605bb1] | 422 | <para>
|
---|
| 423 | To protect an existing <filename>/etc/aliases</filename> file,
|
---|
[417f9e7] | 424 | the above command appends these aliases to it if it exists. This file
|
---|
[2605bb1] | 425 | should be checked and duplicate aliases removed, if present.
|
---|
| 426 | </para>
|
---|
| 427 |
|
---|
[90066bf] | 428 | <para>
|
---|
| 429 | The BLFS editors recommend to use LMDB instead of Berkeley DB for
|
---|
[99492e8e] | 430 | Postfix tables. Add three lines into
|
---|
[90066bf] | 431 | <filename>/etc/postfix/main.cf</filename> to make
|
---|
[99492e8e] | 432 | <command>postmap</command> encode the lookup tables in the LMDB
|
---|
| 433 | format by default and to change the default hash setting of the
|
---|
| 434 | alias tables:
|
---|
[90066bf] | 435 | </para>
|
---|
| 436 |
|
---|
[99492e8e] | 437 | <screen role="root"><userinput>echo 'default_database_type = lmdb' >> /etc/postfix/main.cf &&
|
---|
| 438 | echo 'alias_database = lmdb:/etc/aliases' >> /etc/postfix/main.cf &&
|
---|
| 439 | echo 'alias_maps = lmdb:/etc/aliases' >> /etc/postfix/main.cf</userinput></screen>
|
---|
[90066bf] | 440 |
|
---|
[d524862] | 441 | <para>
|
---|
| 442 | To protect your server against the recent SMTP smuggling attacks,
|
---|
[48ab76b] | 443 | additional steps are required. Add two lines into
|
---|
[fe1f174] | 444 | <filename>/etc/postfix/main.cf</filename> to disconnect remote SMTP
|
---|
[9f3382f] | 445 | clients that send bare newlines in the DATA section, while also
|
---|
| 446 | allowing clients on your network with non-standard SMTP implementations
|
---|
| 447 | to still send mail:
|
---|
[d524862] | 448 | </para>
|
---|
| 449 |
|
---|
[9f3382f] | 450 | <screen role="root"><userinput>echo 'smtpd_forbid_bare_newline = normalize' >> /etc/postfix/main.cf &&
|
---|
[d524862] | 451 | echo 'smtpd_forbid_bare_newline_exclusions = $mynetworks' >> /etc/postfix/main.cf</userinput></screen>
|
---|
| 452 |
|
---|
[90066bf] | 453 | <para>
|
---|
| 454 | Note that if you are following an online tutorial to configure
|
---|
| 455 | Postfix, the tutorial may refer to a lookup table with
|
---|
| 456 | <literal>hash:/path/to/lookup_table</literal>. You should replace
|
---|
| 457 | <literal>hash</literal> with <literal>lmdb</literal> in order to use
|
---|
| 458 | a lookup table encoded in the LMDB format.
|
---|
| 459 | </para>
|
---|
| 460 |
|
---|
[2605bb1] | 461 | <note>
|
---|
| 462 | <para>
|
---|
| 463 | The <filename>/etc/postfix/main.cf</filename> and
|
---|
| 464 | <filename>/etc/postfix/master.cf</filename> files must be personalized
|
---|
| 465 | for your system. The <filename>main.cf</filename> file needs your
|
---|
| 466 | fully qualified hostname. You will find that
|
---|
| 467 | <filename>main.cf</filename> is self documenting, so load it into your
|
---|
| 468 | editor to make the changes you need for your situation.
|
---|
| 469 | </para>
|
---|
[417f9e7] | 470 | </note>
|
---|
| 471 |
|
---|
[58f0b91] | 472 | <note>
|
---|
| 473 | <para>
|
---|
| 474 | <application>Postfix</application> can also be set up to
|
---|
[0d7900a] | 475 | run in a chroot jail. See the file in the source
|
---|
[58f0b91] | 476 | <filename>examples/chroot-setup/LINUX2</filename> for details.
|
---|
| 477 | </para>
|
---|
| 478 | </note>
|
---|
[3df190fb] | 479 |
|
---|
[f818fd6] | 480 | <para>
|
---|
| 481 | To ensure that all permissions are set properly, <application>postfix</application>
|
---|
| 482 | provides a tool which is to be run as the
|
---|
| 483 | <systemitem class="username">root</systemitem> user:
|
---|
| 484 | </para>
|
---|
| 485 |
|
---|
| 486 | <screen role="nodump"><userinput>/usr/sbin/postfix -c /etc/postfix set-permissions</userinput></screen>
|
---|
| 487 |
|
---|
[2605bb1] | 488 | <para>
|
---|
| 489 | If you have an existing configuration, you can run the
|
---|
| 490 | <command>postfix</command> utility to add any necessary definitions to
|
---|
| 491 | your existing files. As the
|
---|
| 492 | <systemitem class="username">root</systemitem> user:
|
---|
| 493 | </para>
|
---|
[cef276c] | 494 |
|
---|
[3fd97c4c] | 495 | <screen role="nodump"><userinput>/usr/sbin/postfix upgrade-configuration</userinput></screen>
|
---|
[cef276c] | 496 |
|
---|
[2605bb1] | 497 | <para>
|
---|
| 498 | Before starting <application>Postfix</application>, you should check
|
---|
| 499 | that your configuration and file permissions will work properly. Run the
|
---|
| 500 | following commands as the <systemitem class="username">root</systemitem>
|
---|
| 501 | user to check and start your <application>Postfix</application> server:
|
---|
| 502 | </para>
|
---|
[cef276c] | 503 |
|
---|
[3fd97c4c] | 504 | <screen role="nodump"><userinput>/usr/sbin/postfix check &&
|
---|
[417f9e7] | 505 | /usr/sbin/postfix start</userinput></screen>
|
---|
[58f0b91] | 506 |
|
---|
[417f9e7] | 507 | </sect3>
|
---|
| 508 |
|
---|
| 509 | <sect3 id="postfix-init">
|
---|
[1258125] | 510 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 511 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
[417f9e7] | 512 |
|
---|
[2605bb1] | 513 | <para>
|
---|
| 514 | To automate the running of Postfix at startup, install the
|
---|
[1258125] | 515 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/postfix</filename>
|
---|
| 516 | init script</phrase>
|
---|
| 517 | <phrase revision="systemd"><filename>postfix.service</filename>
|
---|
| 518 | unit</phrase> included in the
|
---|
| 519 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
[4472e923] | 520 | <xref linkend="systemd-units" revision="systemd"/> package:
|
---|
[2605bb1] | 521 | </para>
|
---|
[417f9e7] | 522 |
|
---|
| 523 | <indexterm zone="postfix postfix-init">
|
---|
| 524 | <primary sortas="f-postfix">postfix</primary>
|
---|
| 525 | </indexterm>
|
---|
| 526 |
|
---|
| 527 | <screen role="root"><userinput>make install-postfix</userinput></screen>
|
---|
[58f0b91] | 528 |
|
---|
[417f9e7] | 529 | </sect3>
|
---|
[58f0b91] | 530 |
|
---|
[417f9e7] | 531 | </sect2>
|
---|
| 532 |
|
---|
| 533 | <sect2 role="content">
|
---|
| 534 | <title>Contents</title>
|
---|
| 535 |
|
---|
| 536 | <segmentedlist>
|
---|
| 537 | <segtitle>Installed Programs</segtitle>
|
---|
[58f0b91] | 538 | <segtitle>Installed Libraries</segtitle>
|
---|
[417f9e7] | 539 | <segtitle>Installed Directories</segtitle>
|
---|
| 540 |
|
---|
| 541 | <seglistitem>
|
---|
[2605bb1] | 542 | <seg>
|
---|
[f13b771] | 543 | mailq (symlink), newaliases (symlink), postalias, postcat, postconf,
|
---|
| 544 | postdrop, postfix, postkick, postlock, postlog, postmap, postmulti,
|
---|
| 545 | postqueue, postsuper, and sendmail
|
---|
[58f0b91] | 546 | </seg>
|
---|
| 547 | <seg>
|
---|
| 548 | None
|
---|
[2605bb1] | 549 | </seg>
|
---|
| 550 | <seg>
|
---|
[0a76c13] | 551 | /{etc,usr/lib}/postfix,
|
---|
| 552 | /usr/share/doc/postfix-&postfix-version; and
|
---|
| 553 | /var/{lib,spool}/postfix
|
---|
[2605bb1] | 554 | </seg>
|
---|
[417f9e7] | 555 | </seglistitem>
|
---|
| 556 | </segmentedlist>
|
---|
| 557 |
|
---|
| 558 | <variablelist>
|
---|
| 559 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 560 | <?dbfo list-presentation="list"?>
|
---|
| 561 | <?dbhtml list-presentation="table"?>
|
---|
| 562 |
|
---|
| 563 | <varlistentry id="mailq">
|
---|
| 564 | <term><command>mailq</command></term>
|
---|
| 565 | <listitem>
|
---|
[2605bb1] | 566 | <para>
|
---|
[4c24eb0a] | 567 | A symlink to <filename>sendmail</filename>
|
---|
[2605bb1] | 568 | </para>
|
---|
[417f9e7] | 569 | <indexterm zone="postfix mailq">
|
---|
| 570 | <primary sortas="b-mailq">mailq</primary>
|
---|
| 571 | </indexterm>
|
---|
| 572 | </listitem>
|
---|
| 573 | </varlistentry>
|
---|
| 574 |
|
---|
| 575 | <varlistentry id="newaliases">
|
---|
| 576 | <term><command>newaliases</command></term>
|
---|
| 577 | <listitem>
|
---|
[2605bb1] | 578 | <para>
|
---|
[4c24eb0a] | 579 | A symlink to <filename>sendmail</filename>
|
---|
[2605bb1] | 580 | </para>
|
---|
[417f9e7] | 581 | <indexterm zone="postfix newaliases">
|
---|
| 582 | <primary sortas="b-newaliases">newaliases</primary>
|
---|
| 583 | </indexterm>
|
---|
| 584 | </listitem>
|
---|
| 585 | </varlistentry>
|
---|
| 586 |
|
---|
[2e8afa9] | 587 | <varlistentry id="postalias">
|
---|
| 588 | <term><command>postalias</command></term>
|
---|
[417f9e7] | 589 | <listitem>
|
---|
[2605bb1] | 590 | <para>
|
---|
| 591 | is a utility for <application>Postfix</application> alias database
|
---|
| 592 | maintenance
|
---|
| 593 | </para>
|
---|
[2e8afa9] | 594 | <indexterm zone="postfix postalias">
|
---|
| 595 | <primary sortas="b-postalias">postalias</primary>
|
---|
[417f9e7] | 596 | </indexterm>
|
---|
| 597 | </listitem>
|
---|
| 598 | </varlistentry>
|
---|
| 599 |
|
---|
| 600 | <varlistentry id="postcat">
|
---|
| 601 | <term><command>postcat</command></term>
|
---|
| 602 | <listitem>
|
---|
[2605bb1] | 603 | <para>
|
---|
| 604 | Prints the contents of files from the
|
---|
[4c24eb0a] | 605 | <application>Postfix</application> queue in human readable format
|
---|
[2605bb1] | 606 | </para>
|
---|
[417f9e7] | 607 | <indexterm zone="postfix postcat">
|
---|
| 608 | <primary sortas="b-postcat">postcat</primary>
|
---|
| 609 | </indexterm>
|
---|
| 610 | </listitem>
|
---|
| 611 | </varlistentry>
|
---|
| 612 |
|
---|
| 613 | <varlistentry id="postconf">
|
---|
| 614 | <term><command>postconf</command></term>
|
---|
| 615 | <listitem>
|
---|
[2605bb1] | 616 | <para>
|
---|
| 617 | Displays or changes the value of
|
---|
[4c24eb0a] | 618 | <application>Postfix</application> configuration parameters
|
---|
[2605bb1] | 619 | </para>
|
---|
[417f9e7] | 620 | <indexterm zone="postfix postconf">
|
---|
| 621 | <primary sortas="b-postconf">postconf</primary>
|
---|
| 622 | </indexterm>
|
---|
| 623 | </listitem>
|
---|
| 624 | </varlistentry>
|
---|
| 625 |
|
---|
| 626 | <varlistentry id="postdrop">
|
---|
| 627 | <term><command>postdrop</command></term>
|
---|
| 628 | <listitem>
|
---|
[2605bb1] | 629 | <para>
|
---|
| 630 | Creates a file in the maildrop directory and copies its standard
|
---|
[4c24eb0a] | 631 | input to the file
|
---|
[2605bb1] | 632 | </para>
|
---|
[417f9e7] | 633 | <indexterm zone="postfix postdrop">
|
---|
| 634 | <primary sortas="b-postdrop">postdrop</primary>
|
---|
| 635 | </indexterm>
|
---|
| 636 | </listitem>
|
---|
| 637 | </varlistentry>
|
---|
| 638 |
|
---|
| 639 | <varlistentry id="postfix-bin">
|
---|
| 640 | <term><command>postfix</command></term>
|
---|
| 641 | <listitem>
|
---|
[2605bb1] | 642 | <para>
|
---|
[4c24eb0a] | 643 | is the <application>Postfix</application> control program
|
---|
[2605bb1] | 644 | </para>
|
---|
[417f9e7] | 645 | <indexterm zone="postfix postfix-bin">
|
---|
| 646 | <primary sortas="b-postfix">postfix</primary>
|
---|
| 647 | </indexterm>
|
---|
| 648 | </listitem>
|
---|
| 649 | </varlistentry>
|
---|
| 650 |
|
---|
| 651 | <varlistentry id="postkick">
|
---|
| 652 | <term><command>postkick</command></term>
|
---|
| 653 | <listitem>
|
---|
[2605bb1] | 654 | <para>
|
---|
| 655 | Sends requests to the specified service over a local transport
|
---|
[4c24eb0a] | 656 | channel
|
---|
[2605bb1] | 657 | </para>
|
---|
[417f9e7] | 658 | <indexterm zone="postfix postkick">
|
---|
| 659 | <primary sortas="b-postkick">postkick</primary>
|
---|
| 660 | </indexterm>
|
---|
| 661 | </listitem>
|
---|
| 662 | </varlistentry>
|
---|
| 663 |
|
---|
| 664 | <varlistentry id="postlock">
|
---|
| 665 | <term><command>postlock</command></term>
|
---|
| 666 | <listitem>
|
---|
[2605bb1] | 667 | <para>
|
---|
| 668 | Locks a mail folder for exclusive use, and executes commands passed
|
---|
[4c24eb0a] | 669 | to it
|
---|
[2605bb1] | 670 | </para>
|
---|
[417f9e7] | 671 | <indexterm zone="postfix postlock">
|
---|
| 672 | <primary sortas="b-postlock">postlock</primary>
|
---|
| 673 | </indexterm>
|
---|
| 674 | </listitem>
|
---|
| 675 | </varlistentry>
|
---|
| 676 |
|
---|
| 677 | <varlistentry id="postlog">
|
---|
| 678 | <term><command>postlog</command></term>
|
---|
| 679 | <listitem>
|
---|
[2605bb1] | 680 | <para>
|
---|
| 681 | A <application>Postfix</application>-compatible logging interface
|
---|
[4c24eb0a] | 682 | for use in, for example, shell scripts
|
---|
[2605bb1] | 683 | </para>
|
---|
[417f9e7] | 684 | <indexterm zone="postfix postlog">
|
---|
| 685 | <primary sortas="b-postlog">postlog</primary>
|
---|
| 686 | </indexterm>
|
---|
| 687 | </listitem>
|
---|
| 688 | </varlistentry>
|
---|
| 689 |
|
---|
| 690 | <varlistentry id="postmap">
|
---|
| 691 | <term><command>postmap</command></term>
|
---|
| 692 | <listitem>
|
---|
[2605bb1] | 693 | <para>
|
---|
| 694 | Creates or queries one or more Postfix lookup tables, or updates an
|
---|
[4c24eb0a] | 695 | existing one
|
---|
[2605bb1] | 696 | </para>
|
---|
[417f9e7] | 697 | <indexterm zone="postfix postmap">
|
---|
| 698 | <primary sortas="b-postmap">postmap</primary>
|
---|
| 699 | </indexterm>
|
---|
| 700 | </listitem>
|
---|
| 701 | </varlistentry>
|
---|
| 702 |
|
---|
[2605bb1] | 703 | <varlistentry id="postmulti">
|
---|
| 704 | <term><command>postmulti</command></term>
|
---|
| 705 | <listitem>
|
---|
| 706 | <para>
|
---|
| 707 | is the <application>Postfix</application> multi-instance manager.
|
---|
| 708 | It allows a system administrator to manage multiple
|
---|
[4c24eb0a] | 709 | <application>Postfix</application> instances on a single host
|
---|
[2605bb1] | 710 | </para>
|
---|
| 711 | <indexterm zone="postfix postmulti">
|
---|
| 712 | <primary sortas="b-postmulti">postmulti</primary>
|
---|
| 713 | </indexterm>
|
---|
| 714 | </listitem>
|
---|
| 715 | </varlistentry>
|
---|
| 716 |
|
---|
[417f9e7] | 717 | <varlistentry id="postqueue">
|
---|
| 718 | <term><command>postqueue</command></term>
|
---|
| 719 | <listitem>
|
---|
[2605bb1] | 720 | <para>
|
---|
[58f0b91] | 721 | The <application>Postfix</application> user interface for
|
---|
[4c24eb0a] | 722 | queue management
|
---|
[58f0b91] | 723 | </para>
|
---|
[417f9e7] | 724 | <indexterm zone="postfix postqueue">
|
---|
| 725 | <primary sortas="b-postqueue">postqueue</primary>
|
---|
| 726 | </indexterm>
|
---|
| 727 | </listitem>
|
---|
| 728 | </varlistentry>
|
---|
| 729 |
|
---|
| 730 | <varlistentry id="postsuper">
|
---|
| 731 | <term><command>postsuper</command></term>
|
---|
| 732 | <listitem>
|
---|
[2605bb1] | 733 | <para>
|
---|
[58f0b91] | 734 | The <application>Postfix</application> user interface for
|
---|
[4c24eb0a] | 735 | superuser queue management
|
---|
[58f0b91] | 736 | </para>
|
---|
[417f9e7] | 737 | <indexterm zone="postfix postsuper">
|
---|
| 738 | <primary sortas="b-postsuper">postsuper</primary>
|
---|
| 739 | </indexterm>
|
---|
| 740 | </listitem>
|
---|
| 741 | </varlistentry>
|
---|
| 742 |
|
---|
| 743 | <varlistentry id="sendmail-postfix">
|
---|
| 744 | <term><command>sendmail</command></term>
|
---|
| 745 | <listitem>
|
---|
[2605bb1] | 746 | <para>
|
---|
| 747 | is the <application>Postfix</application> to
|
---|
[4c24eb0a] | 748 | <application>Sendmail</application> compatibility interface
|
---|
[2605bb1] | 749 | </para>
|
---|
[417f9e7] | 750 | <indexterm zone="postfix sendmail-postfix">
|
---|
| 751 | <primary sortas="b-sendmail">sendmail</primary>
|
---|
| 752 | </indexterm>
|
---|
| 753 | </listitem>
|
---|
| 754 | </varlistentry>
|
---|
[58f0b91] | 755 |
|
---|
[417f9e7] | 756 | </variablelist>
|
---|
[58f0b91] | 757 |
|
---|
[417f9e7] | 758 | </sect2>
|
---|
[58f0b91] | 759 |
|
---|
[f45b1953] | 760 | </sect1>
|
---|