source: server/mail/postfix.xml@ 4c59e83

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 4c59e83 was 4c59e83, checked in by Ken Moffat <ken@…>, 18 months ago

Fix postfix ftbfs when running linux-6.

  • Property mode set to 100644
File size: 22.8 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 "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-&postfix-version;.tar.gz">
12 <!ENTITY postfix-md5sum "bbb2168f85530fe4eaa65408a48e731b">
13 <!ENTITY postfix-size "4.6 MB">
14 <!ENTITY postfix-buildsize "152 MB"> <!-- 152M build, 55M install_root -->
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 <sect1info>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>Postfix-&postfix-version;</title>
26
27 <indexterm zone="postfix">
28 <primary sortas="a-Postfix">Postfix</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to Postfix</title>
33
34 <para>
35 The <application>Postfix</application> package contains a Mail Transport
36 Agent (MTA). This is useful for sending email to other users of your host
37 machine. It can also be configured to be a central mail server for your
38 domain, a mail relay agent or simply a mail delivery agent to your local
39 Internet Service Provider.
40 </para>
41
42 &lfs112_checked;
43
44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
47 <para>
48 Download (HTTP): <ulink url="&postfix-download-http;"/>
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download (FTP): <ulink url="&postfix-download-ftp;"/>
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download MD5 sum: &postfix-md5sum;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download size: &postfix-size;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Estimated disk space required: &postfix-buildsize;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Estimated build time: &postfix-time;
74 </para>
75 </listitem>
76 </itemizedlist>
77<!--
78 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
79 <itemizedlist spacing="compact">
80 <listitem>
81 <para>
82 Required patch:
83 <ulink url="&patch-root;/postfix-&postfix-version;-glibc230_fix-1.patch"/>
84 </para>
85 </listitem>
86 </itemizedlist>
87-->
88 <bridgehead renderas="sect3">Postfix Dependencies</bridgehead>
89
90 <bridgehead renderas="sect4">Recommended</bridgehead>
91 <para role="recommended">
92 <xref linkend="db"/>,
93 <xref linkend="cyrus-sasl"/>, and
94 <xref linkend="libnsl"/>
95 </para>
96
97 <bridgehead renderas="sect4">Optional</bridgehead>
98 <para role="optional">
99 <xref linkend="icu"/> for Email Address Internationalization (SMTPUTF8) support,
100 <xref linkend="mariadb"/> or <ulink url="https://www.mysql.com/">MySQL</ulink>,
101 <xref linkend="openldap"/>,
102 <xref linkend="pcre"/>,
103 <xref linkend="postgresql"/>,
104 <xref linkend="sqlite"/>, and
105 <ulink url="https://cr.yp.to/cdb.html">CDB</ulink> or
106 <ulink url="https://www.corpit.ru/mjt/tinycdb.html">TinyCDB</ulink>
107 </para>
108
109 <para>
110 Note that <application>SQLite</application>,
111 <application>MySQL</application>, <application>PostgreSQL</application>
112 and <application>CDB</application> are only useful if there is a known
113 need for them.
114 </para>
115
116 <para condition="html" role="usernotes">
117 User Notes: <ulink url="&blfs-wiki;/postfix"/>
118 </para>
119 </sect2>
120
121 <sect2 role="installation">
122 <title>Installation of Postfix</title>
123
124 <sect3>
125 <title>Adding Users and Groups</title>
126
127 <para>
128 Before you compile the program, you need to create users and groups that
129 will be expected to be in place during the installation. Add the users
130 and groups with the following commands issued by the
131 <systemitem class="username">root</systemitem> user:
132 </para>
133
134<screen role="root"><userinput>groupadd -g 32 postfix &amp;&amp;
135groupadd -g 33 postdrop &amp;&amp;
136useradd -c "Postfix Daemon User" -d /var/spool/postfix -g postfix \
137 -s /bin/false -u 32 postfix &amp;&amp;
138chown -v postfix:postfix /var/mail</userinput></screen>
139 </sect3>
140
141 <sect3>
142 <title>Configuring the Build</title>
143
144 <para>
145 The README files are formatted to be read with a pager like
146 <application>Less</application> or <application>More</application>.
147 If you want to use a text editor, make them legible with the
148 following sed:
149 </para>
150
151<screen><userinput>sed -i 's/.\x08//g' README_FILES/*</userinput></screen>
152<!--
153 <para>
154 Make an adjustment to allow <application>Postfix</application> to compile
155 on <application>Glibc-2.34</application> and later:
156 </para>
157
158<screen><userinput>sed -i '/&lt;linux/i #define HAS_CLOSEFROM' src/util/sys_defs.h</userinput></screen>
159-->
160 <para>
161 The <filename>Makefile</filename> looks at the running kernel to
162 decide how to set various things. It does not recognize Linux-6 and
163 fails to make the definitions. After that is fixed, the build
164 references the newly defined version in a header, which also breaks
165 the build. Fix both of these with the following commands:
166 </para>
167
168<!-- '&&' on a sed only fails if the file is not present,
169 not if it changes nothing, but we seem to like it -->
170<screen><userinput>sed -i 's/Linux..345/&amp;6/' makedefs &amp;&amp;
171sed -i 's/LINUX2/LINUX6/' src/util/sys_defs.h</userinput></screen>
172
173
174 <para>
175 The <application>Postfix</application> source tree does not contain a
176 <filename>configure</filename> script, rather the makefile in the
177 top-level directory contains a <option>makefiles</option> target that
178 regenerates all the other makefiles in the build tree. If you wish to
179 use additional software such as a database back-end for virtual users,
180 or TLS/SSL authentication, you will need to regenerate the makefiles
181 using one or more of the appropriate <envar>CCARGS</envar> and
182 <envar>AUXLIBS</envar> settings listed below.
183 </para>
184
185 <note>
186 <para>
187 For all variants of the CCARGS you should ensure that -DNO_NIS is
188 specified so that the build does not attempt to access an rpcsvc header
189 which does not exist in BLFS.
190 </para>
191 </note>
192
193 <para>
194 For more details read the readme files.
195 </para>
196<!-- We reverted to Berkeley DB-5.3.28 and that is handled
197 <para>
198 The current version of <xref linkend="db"/> is not recognised by a
199 hard-coded test for known versions. To build with this version use the
200 following sed:
201 </para>
202
203<screen><userinput>sed -i 's/DB_VERSION_MAJOR == 6 .*||/DB_VERSION_MAJOR &gt; 4 ||/' \
204 src/util/dict_db.c</userinput></screen>
205-->
206 <sect4>
207 <title>Cyrus-SASL</title>
208
209 <para>
210 To use <application>Cyrus-SASL</application> with
211 <application>Postfix</application>, use the following arguments:
212 </para>
213
214<screen><literal>CCARGS='-DNO_NIS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl'
215AUXLIBS='-lsasl2'</literal></screen>
216
217 </sect4>
218
219 <sect4>
220 <title>OpenLDAP</title>
221
222 <para>
223 To use <application>OpenLDAP</application> with
224 <application>Postfix</application>, use the following arguments:
225 </para>
226
227<screen><literal>CCARGS='-DNO_NIS -DHAS_LDAP'
228AUXLIBS='-lldap -llber'</literal></screen>
229
230 </sect4>
231
232 <sect4>
233 <title>Sqlite</title>
234
235 <para>
236 To use <application>Sqlite</application> with
237 <application>Postfix</application>, use the following arguments:
238 </para>
239
240<screen><literal>CCARGS='-DNO_NIS -DHAS_SQLITE'
241AUXLIBS='-lsqlite3 -lpthread'</literal></screen>
242
243 </sect4>
244
245 <sect4>
246 <title>MySQL</title>
247
248 <para>
249 To use <application>MySQL</application> with
250 <application>Postfix</application>, use the following arguments:
251 </para>
252
253<screen><literal>CCARGS='-DNO_NIS -DHAS_MYSQL -I/usr/include/mysql'
254AUXLIBS='-lmysqlclient -lz -lm'</literal></screen>
255
256 </sect4>
257
258 <sect4>
259 <title>PostgreSQL</title>
260
261 <para>
262 To use <application>PostgreSQL</application> with
263 <application>Postfix</application>, use the following arguments:
264 </para>
265
266<screen><literal>CCARGS='-DNO_NIS -DHAS_PGSQL -I/usr/include/postgresql'
267AUXLIBS='-lpq -lz -lm'</literal></screen>
268
269 </sect4>
270
271 <sect4>
272 <title>CDB/TinyCDB</title>
273
274 <para>
275 To use <application>CDB</application> or
276 <application>TinyCDB</application> with
277 <application>Postfix</application>, use the following arguments:
278 </para>
279
280<screen><literal>CCARGS='-DNO_NIS -DHAS_CDB'
281AUXLIBS='<replaceable>&lt;/path/to/CDB&gt;</replaceable>/libcdb.a'</literal></screen>
282
283 </sect4>
284
285 <sect4>
286 <title>StartTLS Authentication</title>
287
288 <para>
289 To use <application>OpenSSL</application> with
290 <application>Postfix</application>, use the following arguments:
291 </para>
292
293<screen><literal>CCARGS='-DNO_NIS -DUSE_TLS -I/usr/include/openssl/'
294AUXLIBS='-lssl -lcrypto'</literal></screen>
295 </sect4>
296
297 </sect3>
298
299 <sect3>
300 <title>Installing Postfix</title>
301
302 <para>
303 Adjust the following according to your needs. For example,
304 if you have <application>Cyrus SASL</application>,
305 install <application>Postfix</application> by running the following
306 commands:
307 </para>
308
309<screen><userinput>make CCARGS="-DNO_NIS -DUSE_TLS -I/usr/include/openssl/ \
310 -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" \
311 AUXLIBS="-lssl -lcrypto -lsasl2" \
312 makefiles &amp;&amp;
313make</userinput></screen>
314
315 <!-- There is a testsuite, but it fails a lot. It seems to need
316 the host to be specifically setup for the tests.
317 Run with `make tests' and `make root_tests' -->
318 <para>
319 This package does not come with a useful test suite.
320 </para>
321
322 <para>
323 Now, as the <systemitem class="username">root</systemitem> user:
324 </para>
325
326<!-- dev note: sh postfix-install -non-interactive install_root=<DESTDIR> ... -->
327
328<screen role="root"><userinput>sh postfix-install -non-interactive \
329 daemon_directory=/usr/lib/postfix \
330 manpage_directory=/usr/share/man \
331 html_directory=/usr/share/doc/postfix-&postfix-version;/html \
332 readme_directory=/usr/share/doc/postfix-&postfix-version;/readme</userinput></screen>
333
334 </sect3>
335
336 </sect2>
337
338 <sect2 role="commands">
339 <title>Command Explanations</title>
340
341 <para>
342 <command>make makefiles</command>: This command rebuilds the makefiles
343 throughout the source tree to use the options contained in the
344 <envar>CCARGS</envar> and <envar>AUXLIBS</envar> variables.
345 </para>
346
347 <para>
348 <command>sh postfix-install -non-interactive</command>: This keeps the
349 install script from asking any questions, thereby accepting default
350 destination directories in all but the few cases. If the
351 <option>html_directory</option> and <option>readme_directory</option>
352 options are not set then the documentation will not be installed.
353 </para>
354
355 <para>
356 <option>CCARGS="-DNO_EAI ..."</option>: this will turn off SMTPUTF8
357 support, for example if the rest of your email address infrastructure
358 cannot handle UTF-8 email addresses and message header values.
359 </para>
360
361 </sect2>
362
363 <sect2 role="configuration">
364 <title>Configuring Postfix</title>
365
366 <sect3 id="postfix-config">
367 <title>Config Files</title>
368
369 <para>
370 <filename>/etc/aliases</filename>,
371 <filename>/etc/postfix/main.cf</filename>, and
372 <filename>/etc/postfix/master.cf</filename>
373 </para>
374
375 <indexterm zone="postfix postfix-config">
376 <primary sortas="e-etc-aliases">/etc/aliases</primary>
377 </indexterm>
378
379 <indexterm zone="postfix postfix-config">
380 <primary sortas="e-etc-postfix-star">/etc/postfix/*</primary>
381 </indexterm>
382
383 </sect3>
384
385 <sect3>
386 <title>Configuration Information</title>
387
388 <para>
389 Create (or append to an existing) <filename>/etc/aliases</filename>
390 with the following command. Change
391 <replaceable>&lt;LOGIN&gt;</replaceable> to your non-root login
392 identity so mail addressed to
393 <systemitem class="username">root</systemitem> can be forwarded to you.
394 As the <systemitem class="username">root</systemitem> user:
395 </para>
396
397<screen role="root"><userinput>cat &gt;&gt; /etc/aliases &lt;&lt; "EOF"
398<literal># Begin /etc/aliases
399
400MAILER-DAEMON: postmaster
401postmaster: root
402
403root: <replaceable>&lt;LOGIN&gt;</replaceable>
404# End /etc/aliases</literal>
405EOF</userinput></screen>
406
407 <para>
408 To protect an existing <filename>/etc/aliases</filename> file,
409 the above command appends these aliases to it if it exists. This file
410 should be checked and duplicate aliases removed, if present.
411 </para>
412
413 <note>
414 <para>
415 The <filename>/etc/postfix/main.cf</filename> and
416 <filename>/etc/postfix/master.cf</filename> files must be personalized
417 for your system. The <filename>main.cf</filename> file needs your
418 fully qualified hostname. You will find that
419 <filename>main.cf</filename> is self documenting, so load it into your
420 editor to make the changes you need for your situation.
421 </para>
422 </note>
423
424 <note>
425 <para>
426 <application>Postfix</application> can also be set up to
427 run in a chroot jail. See the file in the source
428 <filename>examples/chroot-setup/LINUX2</filename> for details.
429 </para>
430 </note>
431
432 <para>
433 If you have an existing configuration, you can run the
434 <command>postfix</command> utility to add any necessary definitions to
435 your existing files. As the
436 <systemitem class="username">root</systemitem> user:
437 </para>
438
439<screen role="nodump"><userinput>/usr/sbin/postfix upgrade-configuration</userinput></screen>
440
441 <para>
442 Before starting <application>Postfix</application>, you should check
443 that your configuration and file permissions will work properly. Run the
444 following commands as the <systemitem class="username">root</systemitem>
445 user to check and start your <application>Postfix</application> server:
446 </para>
447
448<screen role="nodump"><userinput>/usr/sbin/postfix check &amp;&amp;
449/usr/sbin/postfix start</userinput></screen>
450
451 </sect3>
452
453 <sect3 id="postfix-init">
454 <title><phrase revision="sysv">Boot Script</phrase>
455 <phrase revision="systemd">Systemd Unit</phrase></title>
456
457 <para>
458 To automate the running of Postfix at startup, install the
459 <phrase revision="sysv"><filename>/etc/rc.d/init.d/postfix</filename>
460 init script</phrase>
461 <phrase revision="systemd"><filename>postfix.service</filename>
462 unit</phrase> included in the
463 <xref linkend="bootscripts" revision="sysv"/>
464 <xref linkend="systemd-units" revision="systemd"/> package:
465 </para>
466
467 <indexterm zone="postfix postfix-init">
468 <primary sortas="f-postfix">postfix</primary>
469 </indexterm>
470
471<screen role="root"><userinput>make install-postfix</userinput></screen>
472
473 </sect3>
474
475 </sect2>
476
477 <sect2 role="content">
478 <title>Contents</title>
479
480 <segmentedlist>
481 <segtitle>Installed Programs</segtitle>
482 <segtitle>Installed Libraries</segtitle>
483 <segtitle>Installed Directories</segtitle>
484
485 <seglistitem>
486 <seg>
487 mailq (symlink), newaliases (symlink), postalias, postcat, postconf,
488 postdrop, postfix, postkick, postlock, postlog, postmap, postmulti,
489 postqueue, postsuper, and sendmail
490 </seg>
491 <seg>
492 None
493 </seg>
494 <seg>
495 /{etc,usr/lib}/postfix,
496 /usr/share/doc/postfix-&postfix-version; and
497 /var/{lib,spool}/postfix
498 </seg>
499 </seglistitem>
500 </segmentedlist>
501
502 <variablelist>
503 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
504 <?dbfo list-presentation="list"?>
505 <?dbhtml list-presentation="table"?>
506
507 <varlistentry id="mailq">
508 <term><command>mailq</command></term>
509 <listitem>
510 <para>
511 A symlink to <filename>sendmail</filename>
512 </para>
513 <indexterm zone="postfix mailq">
514 <primary sortas="b-mailq">mailq</primary>
515 </indexterm>
516 </listitem>
517 </varlistentry>
518
519 <varlistentry id="newaliases">
520 <term><command>newaliases</command></term>
521 <listitem>
522 <para>
523 A symlink to <filename>sendmail</filename>
524 </para>
525 <indexterm zone="postfix newaliases">
526 <primary sortas="b-newaliases">newaliases</primary>
527 </indexterm>
528 </listitem>
529 </varlistentry>
530
531 <varlistentry id="postalias">
532 <term><command>postalias</command></term>
533 <listitem>
534 <para>
535 is a utility for <application>Postfix</application> alias database
536 maintenance
537 </para>
538 <indexterm zone="postfix postalias">
539 <primary sortas="b-postalias">postalias</primary>
540 </indexterm>
541 </listitem>
542 </varlistentry>
543
544 <varlistentry id="postcat">
545 <term><command>postcat</command></term>
546 <listitem>
547 <para>
548 Prints the contents of files from the
549 <application>Postfix</application> queue in human readable format
550 </para>
551 <indexterm zone="postfix postcat">
552 <primary sortas="b-postcat">postcat</primary>
553 </indexterm>
554 </listitem>
555 </varlistentry>
556
557 <varlistentry id="postconf">
558 <term><command>postconf</command></term>
559 <listitem>
560 <para>
561 Displays or changes the value of
562 <application>Postfix</application> configuration parameters
563 </para>
564 <indexterm zone="postfix postconf">
565 <primary sortas="b-postconf">postconf</primary>
566 </indexterm>
567 </listitem>
568 </varlistentry>
569
570 <varlistentry id="postdrop">
571 <term><command>postdrop</command></term>
572 <listitem>
573 <para>
574 Creates a file in the maildrop directory and copies its standard
575 input to the file
576 </para>
577 <indexterm zone="postfix postdrop">
578 <primary sortas="b-postdrop">postdrop</primary>
579 </indexterm>
580 </listitem>
581 </varlistentry>
582
583 <varlistentry id="postfix-bin">
584 <term><command>postfix</command></term>
585 <listitem>
586 <para>
587 is the <application>Postfix</application> control program
588 </para>
589 <indexterm zone="postfix postfix-bin">
590 <primary sortas="b-postfix">postfix</primary>
591 </indexterm>
592 </listitem>
593 </varlistentry>
594
595 <varlistentry id="postkick">
596 <term><command>postkick</command></term>
597 <listitem>
598 <para>
599 Sends requests to the specified service over a local transport
600 channel
601 </para>
602 <indexterm zone="postfix postkick">
603 <primary sortas="b-postkick">postkick</primary>
604 </indexterm>
605 </listitem>
606 </varlistentry>
607
608 <varlistentry id="postlock">
609 <term><command>postlock</command></term>
610 <listitem>
611 <para>
612 Locks a mail folder for exclusive use, and executes commands passed
613 to it
614 </para>
615 <indexterm zone="postfix postlock">
616 <primary sortas="b-postlock">postlock</primary>
617 </indexterm>
618 </listitem>
619 </varlistentry>
620
621 <varlistentry id="postlog">
622 <term><command>postlog</command></term>
623 <listitem>
624 <para>
625 A <application>Postfix</application>-compatible logging interface
626 for use in, for example, shell scripts
627 </para>
628 <indexterm zone="postfix postlog">
629 <primary sortas="b-postlog">postlog</primary>
630 </indexterm>
631 </listitem>
632 </varlistentry>
633
634 <varlistentry id="postmap">
635 <term><command>postmap</command></term>
636 <listitem>
637 <para>
638 Creates or queries one or more Postfix lookup tables, or updates an
639 existing one
640 </para>
641 <indexterm zone="postfix postmap">
642 <primary sortas="b-postmap">postmap</primary>
643 </indexterm>
644 </listitem>
645 </varlistentry>
646
647 <varlistentry id="postmulti">
648 <term><command>postmulti</command></term>
649 <listitem>
650 <para>
651 is the <application>Postfix</application> multi-instance manager.
652 It allows a system administrator to manage multiple
653 <application>Postfix</application> instances on a single host
654 </para>
655 <indexterm zone="postfix postmulti">
656 <primary sortas="b-postmulti">postmulti</primary>
657 </indexterm>
658 </listitem>
659 </varlistentry>
660
661 <varlistentry id="postqueue">
662 <term><command>postqueue</command></term>
663 <listitem>
664 <para>
665 The <application>Postfix</application> user interface for
666 queue management
667 </para>
668 <indexterm zone="postfix postqueue">
669 <primary sortas="b-postqueue">postqueue</primary>
670 </indexterm>
671 </listitem>
672 </varlistentry>
673
674 <varlistentry id="postsuper">
675 <term><command>postsuper</command></term>
676 <listitem>
677 <para>
678 The <application>Postfix</application> user interface for
679 superuser queue management
680 </para>
681 <indexterm zone="postfix postsuper">
682 <primary sortas="b-postsuper">postsuper</primary>
683 </indexterm>
684 </listitem>
685 </varlistentry>
686
687 <varlistentry id="sendmail-postfix">
688 <term><command>sendmail</command></term>
689 <listitem>
690 <para>
691 is the <application>Postfix</application> to
692 <application>Sendmail</application> compatibility interface
693 </para>
694 <indexterm zone="postfix sendmail-postfix">
695 <primary sortas="b-sendmail">sendmail</primary>
696 </indexterm>
697 </listitem>
698 </varlistentry>
699
700 </variablelist>
701
702 </sect2>
703
704</sect1>
Note: See TracBrowser for help on using the repository browser.