source: server/mail/postfix-systemd.xml@ 1be4837c

krejzi/svn
Last change on this file since 1be4837c was 1be4837c, checked in by Krejzi <krejzi@…>, 10 years ago

Convert entire Servers section.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/krejzi@14757 af4574ff-66df-0310-9fd7-8a98e5e911e0

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