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