source: server/mail/postfix.xml@ 1859ee6

12.1 ken/TL2024 lazarus plabs/newcss python3.11 rahul/power-profiles-daemon trunk xry111/llvm18
Last change on this file since 1859ee6 was dcd5a063, checked in by Bruce Dubbs <bdubbs@…>, 6 months ago

Archive Berkeley DB

  • Property mode set to 100644
File size: 23.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
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">
11 <!ENTITY postfix-download-ftp " ">
12 <!ENTITY postfix-md5sum "7edfadf15fafe73523266829172d890f">
13 <!ENTITY postfix-size "4.6 MB">
14 <!ENTITY postfix-buildsize "156 MB">
15 <!ENTITY postfix-time "0.2 SBU (Using parallelism=4)">
16]>
17
18<sect1 id="postfix" xreflabel="Postfix-&postfix-version;">
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
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>
38
39 &lfs120_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&postfix-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&postfix-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &postfix-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &postfix-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &postfix-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &postfix-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74<!--
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>
84-->
85 <bridgehead renderas="sect3">Postfix Dependencies</bridgehead>
86
87 <bridgehead renderas="sect4">Recommended</bridgehead>
88 <para role="recommended">
89 <xref linkend="cyrus-sasl"/>,
90 <xref linkend="libnsl"/>, and
91 <xref linkend="lmdb"/>
92 </para>
93
94 <bridgehead renderas="sect4">Optional</bridgehead>
95 <para role="optional">
96 <xref linkend="icu"/> for Email Address Internationalization (SMTPUTF8) support,
97 <xref linkend="mariadb"/> or <ulink url="https://www.mysql.com/">MySQL</ulink>,
98 <xref linkend="openldap"/>,
99 <xref linkend="pcre2"/> (<emphasis>or</emphasis> the deprecated <xref
100 role='nodep' linkend='pcre'/>),
101 <xref linkend="postgresql"/>,
102 <xref linkend="sqlite"/>,
103 &berkeley-db;, and
104 <ulink url="https://cr.yp.to/cdb.html">CDB</ulink> or
105 <ulink url="https://www.corpit.ru/mjt/tinycdb.html">TinyCDB</ulink>
106 </para>
107
108 <para>
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
112 need for them.
113 </para>
114
115 <para condition="html" role="usernotes">
116 Editor Notes: <ulink url="&blfs-wiki;/postfix"/>
117 </para>
118 </sect2>
119
120 <sect2 role="installation">
121 <title>Installation of Postfix</title>
122
123 <sect3>
124 <title>Adding Users and Groups</title>
125
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 &amp;&amp;
134groupadd -g 33 postdrop &amp;&amp;
135useradd -c "Postfix Daemon User" -d /var/spool/postfix -g postfix \
136 -s /bin/false -u 32 postfix &amp;&amp;
137chown -v postfix:postfix /var/mail</userinput></screen>
138 </sect3>
139
140 <sect3>
141 <title>Configuring the Build</title>
142
143 <para>
144 The README files are formatted to be read with a pager like
145 <application>less</application> or <application>more</application>.
146 If you want to use a text editor, make them legible with the
147 following sed:
148 </para>
149
150<screen><userinput>sed -i 's/.\x08//g' README_FILES/*</userinput></screen>
151
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
163 <note>
164 <para>
165 For all variants of the CCARGS you should ensure that -DNO_NIS is
166 specified so that the build does not attempt to access an rpcsvc
167 header which do not exist in BLFS. If &berkeley-db; is
168 not installed, -DNO_DB needs to be specified as well.
169 </para>
170 </note>
171
172 <para>
173 For more details read the readme files.
174 </para>
175
176 <sect4>
177 <title>Cyrus-SASL</title>
178
179 <para>
180 To use <application>Cyrus-SASL</application> with
181 <application>Postfix</application>, use the following arguments:
182 </para>
183
184<screen><literal>CCARGS="-DNO_NIS -DNO_DB \
185 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
186AUXLIBS='-lsasl2'</literal></screen>
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>
195
196<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_LMDB'
197AUXLIBS_LMDB='-llmdb'</literal></screen>
198 </sect4>
199
200 <sect4>
201 <title>OpenLDAP</title>
202
203 <para>
204 To use <application>OpenLDAP</application> with
205 <application>Postfix</application>, use the following arguments:
206 </para>
207
208<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_LDAP'
209AUXLIBS_LDAP='-lldap -llber'</literal></screen>
210
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>
220
221<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_SQLITE'
222AUXLIBS_SQLITE='-lsqlite3 -lpthread'</literal></screen>
223
224 </sect4>
225
226 <sect4>
227 <title>MySQL</title>
228
229 <para>
230 To use <application>MySQL</application> with
231 <application>Postfix</application>, use the following arguments:
232 </para>
233
234<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_MYSQL -I/usr/include/mysql'
235AUXLIBS_MYSQL='-lmysqlclient -lz -lm'</literal></screen>
236
237 </sect4>
238
239 <sect4>
240 <title>PostgreSQL</title>
241
242 <para>
243 To use <application>PostgreSQL</application> with
244 <application>Postfix</application>, use the following arguments:
245 </para>
246
247<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_PGSQL -I/usr/include/postgresql'
248AUXLIBS_PGSQL='-lpq -lz -lm'</literal></screen>
249
250 </sect4>
251
252 <sect4>
253 <title>CDB/TinyCDB</title>
254
255 <para>
256 To use <application>CDB</application> or
257 <application>TinyCDB</application> with
258 <application>Postfix</application>, use the following arguments:
259 </para>
260
261<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DHAS_CDB'
262AUXLIBS_CDB='<replaceable>&lt;/path/to/CDB&gt;</replaceable>/libcdb.a'</literal></screen>
263
264 </sect4>
265
266 <sect4>
267 <title>StartTLS Authentication</title>
268
269 <para>
270 To use <application>OpenSSL</application> with
271 <application>Postfix</application>, use the following arguments:
272 </para>
273
274<screen><literal>CCARGS='-DNO_NIS -DNO_DB -DUSE_TLS -I/usr/include/openssl/'
275AUXLIBS='-lssl -lcrypto'</literal></screen>
276 </sect4>
277
278 </sect3>
279
280 <sect3>
281 <title>Installing Postfix</title>
282
283 <para>
284 Adjust the following according to your needs. For example,
285 if you have <application>Cyrus SASL</application> and
286 <application>LMDB</application>,
287 install <application>Postfix</application> by running the following
288 commands:
289 </para>
290
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" \
294 AUXLIBS="-lssl -lcrypto -lsasl2" \
295 AUXLIBS_LMDB="-llmdb" \
296 makefiles &amp;&amp;
297make</userinput></screen>
298
299 <!-- There is a test suite, but it fails a lot. It seems to need
300 the host to be specifically setup for the tests.
301 Run with `make tests' and `make root_tests' -->
302 <para>
303 This package does not come with a useful test suite.
304 </para>
305
306 <para>
307 Now, as the <systemitem class="username">root</systemitem> user:
308 </para>
309
310<!-- dev note: sh postfix-install -non-interactive install_root=<DESTDIR> ... -->
311
312<screen role="root"><userinput>sh postfix-install -non-interactive \
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
318 </sect3>
319
320 </sect2>
321
322 <sect2 role="commands">
323 <title>Command Explanations</title>
324
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>
330
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>
338
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
345 </sect2>
346
347 <sect2 role="configuration">
348 <title>Configuring Postfix</title>
349
350 <sect3 id="postfix-config">
351 <title>Config Files</title>
352
353 <para>
354 <filename>/etc/aliases</filename>,
355 <filename>/etc/postfix/main.cf</filename>, and
356 <filename>/etc/postfix/master.cf</filename>
357 </para>
358
359 <indexterm zone="postfix postfix-config">
360 <primary sortas="e-etc-aliases">/etc/aliases</primary>
361 </indexterm>
362
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
372 <para>
373 Create (or append to an existing) <filename>/etc/aliases</filename>
374 with the following command. Change
375 <replaceable>&lt;LOGIN&gt;</replaceable> to your non-root login
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
381<screen role="root"><userinput>cat &gt;&gt; /etc/aliases &lt;&lt; "EOF"
382<literal># Begin /etc/aliases
383
384MAILER-DAEMON: postmaster
385postmaster: root
386
387root: <replaceable>&lt;LOGIN&gt;</replaceable>
388# End /etc/aliases</literal>
389EOF</userinput></screen>
390
391 <para>
392 To protect an existing <filename>/etc/aliases</filename> file,
393 the above command appends these aliases to it if it exists. This file
394 should be checked and duplicate aliases removed, if present.
395 </para>
396
397 <para>
398 The BLFS editors recommend to use LMDB instead of Berkeley DB for
399 Postfix lookup tables. Add a line into
400 <filename>/etc/postfix/main.cf</filename> to make
401 <command>postmap</command> to encode the lookup tables in the LMDB
402 format by default:
403 </para>
404
405<screen role="root"><userinput>echo 'default_database_type = lmdb' &gt;&gt; /etc/postfix/main.cf</userinput></screen>
406
407 <para>
408 Note that if you are following an online tutorial to configure
409 Postfix, the tutorial may refer to a lookup table with
410 <literal>hash:/path/to/lookup_table</literal>. You should replace
411 <literal>hash</literal> with <literal>lmdb</literal> in order to use
412 a lookup table encoded in the LMDB format.
413 </para>
414
415 <note>
416 <para>
417 The <filename>/etc/postfix/main.cf</filename> and
418 <filename>/etc/postfix/master.cf</filename> files must be personalized
419 for your system. The <filename>main.cf</filename> file needs your
420 fully qualified hostname. You will find that
421 <filename>main.cf</filename> is self documenting, so load it into your
422 editor to make the changes you need for your situation.
423 </para>
424 </note>
425
426 <note>
427 <para>
428 <application>Postfix</application> can also be set up to
429 run in a chroot jail. See the file in the source
430 <filename>examples/chroot-setup/LINUX2</filename> for details.
431 </para>
432 </note>
433
434 <para>
435 To ensure that all permissions are set properly, <application>postfix</application>
436 provides a tool which is to be run as the
437 <systemitem class="username">root</systemitem> user:
438 </para>
439
440<screen role="nodump"><userinput>/usr/sbin/postfix -c /etc/postfix set-permissions</userinput></screen>
441
442 <para>
443 If you have an existing configuration, you can run the
444 <command>postfix</command> utility to add any necessary definitions to
445 your existing files. As the
446 <systemitem class="username">root</systemitem> user:
447 </para>
448
449<screen role="nodump"><userinput>/usr/sbin/postfix upgrade-configuration</userinput></screen>
450
451 <para>
452 Before starting <application>Postfix</application>, you should check
453 that your configuration and file permissions will work properly. Run the
454 following commands as the <systemitem class="username">root</systemitem>
455 user to check and start your <application>Postfix</application> server:
456 </para>
457
458<screen role="nodump"><userinput>/usr/sbin/postfix check &amp;&amp;
459/usr/sbin/postfix start</userinput></screen>
460
461 </sect3>
462
463 <sect3 id="postfix-init">
464 <title><phrase revision="sysv">Boot Script</phrase>
465 <phrase revision="systemd">Systemd Unit</phrase></title>
466
467 <para>
468 To automate the running of Postfix at startup, install the
469 <phrase revision="sysv"><filename>/etc/rc.d/init.d/postfix</filename>
470 init script</phrase>
471 <phrase revision="systemd"><filename>postfix.service</filename>
472 unit</phrase> included in the
473 <xref linkend="bootscripts" revision="sysv"/>
474 <xref linkend="systemd-units" revision="systemd"/> package:
475 </para>
476
477 <indexterm zone="postfix postfix-init">
478 <primary sortas="f-postfix">postfix</primary>
479 </indexterm>
480
481<screen role="root"><userinput>make install-postfix</userinput></screen>
482
483 </sect3>
484
485 </sect2>
486
487 <sect2 role="content">
488 <title>Contents</title>
489
490 <segmentedlist>
491 <segtitle>Installed Programs</segtitle>
492 <segtitle>Installed Libraries</segtitle>
493 <segtitle>Installed Directories</segtitle>
494
495 <seglistitem>
496 <seg>
497 mailq (symlink), newaliases (symlink), postalias, postcat, postconf,
498 postdrop, postfix, postkick, postlock, postlog, postmap, postmulti,
499 postqueue, postsuper, and sendmail
500 </seg>
501 <seg>
502 None
503 </seg>
504 <seg>
505 /{etc,usr/lib}/postfix,
506 /usr/share/doc/postfix-&postfix-version; and
507 /var/{lib,spool}/postfix
508 </seg>
509 </seglistitem>
510 </segmentedlist>
511
512 <variablelist>
513 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
514 <?dbfo list-presentation="list"?>
515 <?dbhtml list-presentation="table"?>
516
517 <varlistentry id="mailq">
518 <term><command>mailq</command></term>
519 <listitem>
520 <para>
521 A symlink to <filename>sendmail</filename>
522 </para>
523 <indexterm zone="postfix mailq">
524 <primary sortas="b-mailq">mailq</primary>
525 </indexterm>
526 </listitem>
527 </varlistentry>
528
529 <varlistentry id="newaliases">
530 <term><command>newaliases</command></term>
531 <listitem>
532 <para>
533 A symlink to <filename>sendmail</filename>
534 </para>
535 <indexterm zone="postfix newaliases">
536 <primary sortas="b-newaliases">newaliases</primary>
537 </indexterm>
538 </listitem>
539 </varlistentry>
540
541 <varlistentry id="postalias">
542 <term><command>postalias</command></term>
543 <listitem>
544 <para>
545 is a utility for <application>Postfix</application> alias database
546 maintenance
547 </para>
548 <indexterm zone="postfix postalias">
549 <primary sortas="b-postalias">postalias</primary>
550 </indexterm>
551 </listitem>
552 </varlistentry>
553
554 <varlistentry id="postcat">
555 <term><command>postcat</command></term>
556 <listitem>
557 <para>
558 Prints the contents of files from the
559 <application>Postfix</application> queue in human readable format
560 </para>
561 <indexterm zone="postfix postcat">
562 <primary sortas="b-postcat">postcat</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 <varlistentry id="postconf">
568 <term><command>postconf</command></term>
569 <listitem>
570 <para>
571 Displays or changes the value of
572 <application>Postfix</application> configuration parameters
573 </para>
574 <indexterm zone="postfix postconf">
575 <primary sortas="b-postconf">postconf</primary>
576 </indexterm>
577 </listitem>
578 </varlistentry>
579
580 <varlistentry id="postdrop">
581 <term><command>postdrop</command></term>
582 <listitem>
583 <para>
584 Creates a file in the maildrop directory and copies its standard
585 input to the file
586 </para>
587 <indexterm zone="postfix postdrop">
588 <primary sortas="b-postdrop">postdrop</primary>
589 </indexterm>
590 </listitem>
591 </varlistentry>
592
593 <varlistentry id="postfix-bin">
594 <term><command>postfix</command></term>
595 <listitem>
596 <para>
597 is the <application>Postfix</application> control program
598 </para>
599 <indexterm zone="postfix postfix-bin">
600 <primary sortas="b-postfix">postfix</primary>
601 </indexterm>
602 </listitem>
603 </varlistentry>
604
605 <varlistentry id="postkick">
606 <term><command>postkick</command></term>
607 <listitem>
608 <para>
609 Sends requests to the specified service over a local transport
610 channel
611 </para>
612 <indexterm zone="postfix postkick">
613 <primary sortas="b-postkick">postkick</primary>
614 </indexterm>
615 </listitem>
616 </varlistentry>
617
618 <varlistentry id="postlock">
619 <term><command>postlock</command></term>
620 <listitem>
621 <para>
622 Locks a mail folder for exclusive use, and executes commands passed
623 to it
624 </para>
625 <indexterm zone="postfix postlock">
626 <primary sortas="b-postlock">postlock</primary>
627 </indexterm>
628 </listitem>
629 </varlistentry>
630
631 <varlistentry id="postlog">
632 <term><command>postlog</command></term>
633 <listitem>
634 <para>
635 A <application>Postfix</application>-compatible logging interface
636 for use in, for example, shell scripts
637 </para>
638 <indexterm zone="postfix postlog">
639 <primary sortas="b-postlog">postlog</primary>
640 </indexterm>
641 </listitem>
642 </varlistentry>
643
644 <varlistentry id="postmap">
645 <term><command>postmap</command></term>
646 <listitem>
647 <para>
648 Creates or queries one or more Postfix lookup tables, or updates an
649 existing one
650 </para>
651 <indexterm zone="postfix postmap">
652 <primary sortas="b-postmap">postmap</primary>
653 </indexterm>
654 </listitem>
655 </varlistentry>
656
657 <varlistentry id="postmulti">
658 <term><command>postmulti</command></term>
659 <listitem>
660 <para>
661 is the <application>Postfix</application> multi-instance manager.
662 It allows a system administrator to manage multiple
663 <application>Postfix</application> instances on a single host
664 </para>
665 <indexterm zone="postfix postmulti">
666 <primary sortas="b-postmulti">postmulti</primary>
667 </indexterm>
668 </listitem>
669 </varlistentry>
670
671 <varlistentry id="postqueue">
672 <term><command>postqueue</command></term>
673 <listitem>
674 <para>
675 The <application>Postfix</application> user interface for
676 queue management
677 </para>
678 <indexterm zone="postfix postqueue">
679 <primary sortas="b-postqueue">postqueue</primary>
680 </indexterm>
681 </listitem>
682 </varlistentry>
683
684 <varlistentry id="postsuper">
685 <term><command>postsuper</command></term>
686 <listitem>
687 <para>
688 The <application>Postfix</application> user interface for
689 superuser queue management
690 </para>
691 <indexterm zone="postfix postsuper">
692 <primary sortas="b-postsuper">postsuper</primary>
693 </indexterm>
694 </listitem>
695 </varlistentry>
696
697 <varlistentry id="sendmail-postfix">
698 <term><command>sendmail</command></term>
699 <listitem>
700 <para>
701 is the <application>Postfix</application> to
702 <application>Sendmail</application> compatibility interface
703 </para>
704 <indexterm zone="postfix sendmail-postfix">
705 <primary sortas="b-sendmail">sendmail</primary>
706 </indexterm>
707 </listitem>
708 </varlistentry>
709
710 </variablelist>
711
712 </sect2>
713
714</sect1>
Note: See TracBrowser for help on using the repository browser.