source: server/mail/postfix.xml@ 99492e8e

12.1 ken/TL2024 lazarus plabs/newcss python3.11 rahul/power-profiles-daemon trunk xry111/llvm18
Last change on this file since 99492e8e was 99492e8e, checked in by Ken Moffat <ken@…>, 6 months ago

postifx - remove linginging hash: references.

  • Property mode set to 100644
File size: 23.5 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 tables. Add three lines into
400 <filename>/etc/postfix/main.cf</filename> to make
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:
404 </para>
405
406<screen role="root"><userinput>echo 'default_database_type = lmdb' &gt;&gt; /etc/postfix/main.cf &amp;&amp;
407echo 'alias_database = lmdb:/etc/aliases' &gt;&gt; /etc/postfix/main.cf &amp;&amp;
408echo 'alias_maps = lmdb:/etc/aliases' &gt;&gt; /etc/postfix/main.cf</userinput></screen>
409
410 <para>
411 Note that if you are following an online tutorial to configure
412 Postfix, the tutorial may refer to a lookup table with
413 <literal>hash:/path/to/lookup_table</literal>. You should replace
414 <literal>hash</literal> with <literal>lmdb</literal> in order to use
415 a lookup table encoded in the LMDB format.
416 </para>
417
418 <note>
419 <para>
420 The <filename>/etc/postfix/main.cf</filename> and
421 <filename>/etc/postfix/master.cf</filename> files must be personalized
422 for your system. The <filename>main.cf</filename> file needs your
423 fully qualified hostname. You will find that
424 <filename>main.cf</filename> is self documenting, so load it into your
425 editor to make the changes you need for your situation.
426 </para>
427 </note>
428
429 <note>
430 <para>
431 <application>Postfix</application> can also be set up to
432 run in a chroot jail. See the file in the source
433 <filename>examples/chroot-setup/LINUX2</filename> for details.
434 </para>
435 </note>
436
437 <para>
438 To ensure that all permissions are set properly, <application>postfix</application>
439 provides a tool which is to be run as the
440 <systemitem class="username">root</systemitem> user:
441 </para>
442
443<screen role="nodump"><userinput>/usr/sbin/postfix -c /etc/postfix set-permissions</userinput></screen>
444
445 <para>
446 If you have an existing configuration, you can run the
447 <command>postfix</command> utility to add any necessary definitions to
448 your existing files. As the
449 <systemitem class="username">root</systemitem> user:
450 </para>
451
452<screen role="nodump"><userinput>/usr/sbin/postfix upgrade-configuration</userinput></screen>
453
454 <para>
455 Before starting <application>Postfix</application>, you should check
456 that your configuration and file permissions will work properly. Run the
457 following commands as the <systemitem class="username">root</systemitem>
458 user to check and start your <application>Postfix</application> server:
459 </para>
460
461<screen role="nodump"><userinput>/usr/sbin/postfix check &amp;&amp;
462/usr/sbin/postfix start</userinput></screen>
463
464 </sect3>
465
466 <sect3 id="postfix-init">
467 <title><phrase revision="sysv">Boot Script</phrase>
468 <phrase revision="systemd">Systemd Unit</phrase></title>
469
470 <para>
471 To automate the running of Postfix at startup, install the
472 <phrase revision="sysv"><filename>/etc/rc.d/init.d/postfix</filename>
473 init script</phrase>
474 <phrase revision="systemd"><filename>postfix.service</filename>
475 unit</phrase> included in the
476 <xref linkend="bootscripts" revision="sysv"/>
477 <xref linkend="systemd-units" revision="systemd"/> package:
478 </para>
479
480 <indexterm zone="postfix postfix-init">
481 <primary sortas="f-postfix">postfix</primary>
482 </indexterm>
483
484<screen role="root"><userinput>make install-postfix</userinput></screen>
485
486 </sect3>
487
488 </sect2>
489
490 <sect2 role="content">
491 <title>Contents</title>
492
493 <segmentedlist>
494 <segtitle>Installed Programs</segtitle>
495 <segtitle>Installed Libraries</segtitle>
496 <segtitle>Installed Directories</segtitle>
497
498 <seglistitem>
499 <seg>
500 mailq (symlink), newaliases (symlink), postalias, postcat, postconf,
501 postdrop, postfix, postkick, postlock, postlog, postmap, postmulti,
502 postqueue, postsuper, and sendmail
503 </seg>
504 <seg>
505 None
506 </seg>
507 <seg>
508 /{etc,usr/lib}/postfix,
509 /usr/share/doc/postfix-&postfix-version; and
510 /var/{lib,spool}/postfix
511 </seg>
512 </seglistitem>
513 </segmentedlist>
514
515 <variablelist>
516 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
517 <?dbfo list-presentation="list"?>
518 <?dbhtml list-presentation="table"?>
519
520 <varlistentry id="mailq">
521 <term><command>mailq</command></term>
522 <listitem>
523 <para>
524 A symlink to <filename>sendmail</filename>
525 </para>
526 <indexterm zone="postfix mailq">
527 <primary sortas="b-mailq">mailq</primary>
528 </indexterm>
529 </listitem>
530 </varlistentry>
531
532 <varlistentry id="newaliases">
533 <term><command>newaliases</command></term>
534 <listitem>
535 <para>
536 A symlink to <filename>sendmail</filename>
537 </para>
538 <indexterm zone="postfix newaliases">
539 <primary sortas="b-newaliases">newaliases</primary>
540 </indexterm>
541 </listitem>
542 </varlistentry>
543
544 <varlistentry id="postalias">
545 <term><command>postalias</command></term>
546 <listitem>
547 <para>
548 is a utility for <application>Postfix</application> alias database
549 maintenance
550 </para>
551 <indexterm zone="postfix postalias">
552 <primary sortas="b-postalias">postalias</primary>
553 </indexterm>
554 </listitem>
555 </varlistentry>
556
557 <varlistentry id="postcat">
558 <term><command>postcat</command></term>
559 <listitem>
560 <para>
561 Prints the contents of files from the
562 <application>Postfix</application> queue in human readable format
563 </para>
564 <indexterm zone="postfix postcat">
565 <primary sortas="b-postcat">postcat</primary>
566 </indexterm>
567 </listitem>
568 </varlistentry>
569
570 <varlistentry id="postconf">
571 <term><command>postconf</command></term>
572 <listitem>
573 <para>
574 Displays or changes the value of
575 <application>Postfix</application> configuration parameters
576 </para>
577 <indexterm zone="postfix postconf">
578 <primary sortas="b-postconf">postconf</primary>
579 </indexterm>
580 </listitem>
581 </varlistentry>
582
583 <varlistentry id="postdrop">
584 <term><command>postdrop</command></term>
585 <listitem>
586 <para>
587 Creates a file in the maildrop directory and copies its standard
588 input to the file
589 </para>
590 <indexterm zone="postfix postdrop">
591 <primary sortas="b-postdrop">postdrop</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="postfix-bin">
597 <term><command>postfix</command></term>
598 <listitem>
599 <para>
600 is the <application>Postfix</application> control program
601 </para>
602 <indexterm zone="postfix postfix-bin">
603 <primary sortas="b-postfix">postfix</primary>
604 </indexterm>
605 </listitem>
606 </varlistentry>
607
608 <varlistentry id="postkick">
609 <term><command>postkick</command></term>
610 <listitem>
611 <para>
612 Sends requests to the specified service over a local transport
613 channel
614 </para>
615 <indexterm zone="postfix postkick">
616 <primary sortas="b-postkick">postkick</primary>
617 </indexterm>
618 </listitem>
619 </varlistentry>
620
621 <varlistentry id="postlock">
622 <term><command>postlock</command></term>
623 <listitem>
624 <para>
625 Locks a mail folder for exclusive use, and executes commands passed
626 to it
627 </para>
628 <indexterm zone="postfix postlock">
629 <primary sortas="b-postlock">postlock</primary>
630 </indexterm>
631 </listitem>
632 </varlistentry>
633
634 <varlistentry id="postlog">
635 <term><command>postlog</command></term>
636 <listitem>
637 <para>
638 A <application>Postfix</application>-compatible logging interface
639 for use in, for example, shell scripts
640 </para>
641 <indexterm zone="postfix postlog">
642 <primary sortas="b-postlog">postlog</primary>
643 </indexterm>
644 </listitem>
645 </varlistentry>
646
647 <varlistentry id="postmap">
648 <term><command>postmap</command></term>
649 <listitem>
650 <para>
651 Creates or queries one or more Postfix lookup tables, or updates an
652 existing one
653 </para>
654 <indexterm zone="postfix postmap">
655 <primary sortas="b-postmap">postmap</primary>
656 </indexterm>
657 </listitem>
658 </varlistentry>
659
660 <varlistentry id="postmulti">
661 <term><command>postmulti</command></term>
662 <listitem>
663 <para>
664 is the <application>Postfix</application> multi-instance manager.
665 It allows a system administrator to manage multiple
666 <application>Postfix</application> instances on a single host
667 </para>
668 <indexterm zone="postfix postmulti">
669 <primary sortas="b-postmulti">postmulti</primary>
670 </indexterm>
671 </listitem>
672 </varlistentry>
673
674 <varlistentry id="postqueue">
675 <term><command>postqueue</command></term>
676 <listitem>
677 <para>
678 The <application>Postfix</application> user interface for
679 queue management
680 </para>
681 <indexterm zone="postfix postqueue">
682 <primary sortas="b-postqueue">postqueue</primary>
683 </indexterm>
684 </listitem>
685 </varlistentry>
686
687 <varlistentry id="postsuper">
688 <term><command>postsuper</command></term>
689 <listitem>
690 <para>
691 The <application>Postfix</application> user interface for
692 superuser queue management
693 </para>
694 <indexterm zone="postfix postsuper">
695 <primary sortas="b-postsuper">postsuper</primary>
696 </indexterm>
697 </listitem>
698 </varlistentry>
699
700 <varlistentry id="sendmail-postfix">
701 <term><command>sendmail</command></term>
702 <listitem>
703 <para>
704 is the <application>Postfix</application> to
705 <application>Sendmail</application> compatibility interface
706 </para>
707 <indexterm zone="postfix sendmail-postfix">
708 <primary sortas="b-sendmail">sendmail</primary>
709 </indexterm>
710 </listitem>
711 </varlistentry>
712
713 </variablelist>
714
715 </sect2>
716
717</sect1>
Note: See TracBrowser for help on using the repository browser.