source: server/mail/sendmail.xml@ 4472e923

10.0 10.1 11.0 11.1 11.2 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 upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 4472e923 was 4472e923, checked in by Pierre Labastie <pieere@…>, 4 years ago

Finish formatting the "server" chapter

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22813 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 17.0 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 <!-- Downloads a web page
8 <!ENTITY sendmail-download-http "http://www.sendmail.org/ftp/sendmail.&sendmail-version;.tar.gz"> -->
9 <!ENTITY sendmail-download-http " ">
10 <!ENTITY sendmail-download-ftp "ftp://ftp.sendmail.org/pub/sendmail/sendmail.&sendmail-version;.tar.gz">
11 <!ENTITY sendmail-md5sum "a824fa7dea4d3341efb6462ccd816f00">
12 <!ENTITY sendmail-size "2.1 MB">
13 <!ENTITY sendmail-buildsize "14 MB">
14 <!ENTITY sendmail-time "0.2 SBU">
15]>
16
17<sect1 id="sendmail" xreflabel="sendmail-&sendmail-version;">
18 <?dbhtml filename="sendmail.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>sendmail-&sendmail-version;</title>
26
27 <indexterm zone="sendmail">
28 <primary sortas="a-sendmail">sendmail</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to sendmail</title>
33
34 <para>
35 The <application>sendmail</application> package contains a Mail
36 Transport Agent (MTA).
37 </para>
38
39 &lfs91_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&sendmail-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&sendmail-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &sendmail-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &sendmail-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &sendmail-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &sendmail-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
76
77 <itemizedlist spacing="compact">
78 <listitem>
79 <para>
80 Required patch:
81 <ulink url="&patch-root;/sendmail.&sendmail-version;-openssl-1.patch"/>
82 </para>
83 </listitem>
84 </itemizedlist>
85
86 <bridgehead renderas="sect3">sendmail Dependencies</bridgehead>
87
88 <bridgehead renderas="sect4">Required</bridgehead>
89 <para role="required">
90 <xref linkend="openldap"/> (client)
91 </para>
92
93 <bridgehead renderas="sect4">Recommended</bridgehead>
94 <para role="recommended">
95 <xref linkend="cyrus-sasl"/>
96 </para>
97
98 <bridgehead renderas="sect4">Optional</bridgehead>
99 <para role="optional">
100 <xref linkend="gs"/> (for creating PDF documentation),
101 <xref linkend="procmail"/> (the configuration proposed below requires
102 that <command>procmail</command> be present at run-time), and
103 <ulink url="https://github.com/chaos/nph">nph</ulink>
104 </para>
105
106 <para condition="html" role="usernotes">User Notes:
107 <ulink url="&blfs-wiki;/sendmail"/></para>
108
109 </sect2>
110
111 <sect2 role="installation">
112 <title>Installation of sendmail</title>
113
114 <para>
115 Before building <application>sendmail</application>, create the
116 required user, group and directory with the following commands issued as
117 the <systemitem class="username">root</systemitem> user:
118 </para>
119
120<screen role="root"><userinput>groupadd -g 26 smmsp &amp;&amp;
121useradd -c "Sendmail Daemon" -g smmsp -d /dev/null \
122 -s /bin/false -u 26 smmsp &amp;&amp;
123chmod -v 1777 /var/mail &amp;&amp;
124install -v -m700 -d /var/spool/mqueue</userinput></screen>
125
126 <note>
127 <para>
128 See the source tree <filename>sendmail/README</filename> file
129 for information on linking optional packages into the build. Use the
130 example below, which adds support for SASL, StartTLS
131 (<application>OpenSSL</application>) and
132 <application>OpenLDAP</application>, as a starting point. Of course,
133 modify it to suit your particular needs.
134 </para>
135 </note>
136
137<screen><userinput>cat &gt;&gt; devtools/Site/site.config.m4 &lt;&lt; "EOF"
138<literal>APPENDDEF(`confENVDEF',`-DSTARTTLS -DSASL -DLDAPMAP')
139APPENDDEF(`confLIBS', `-lssl -lcrypto -lsasl2 -lldap -llber -ldb')
140APPENDDEF(`confINCDIRS', `-I/usr/include/sasl')</literal>
141EOF</userinput></screen>
142
143 <para>
144 Install <application>sendmail</application> with the following commands:
145 </para>
146
147<screen><userinput>patch -Np1 -i ../sendmail.&sendmail-version;-openssl-1.patch &amp;&amp;
148
149cat &gt;&gt; devtools/Site/site.config.m4 &lt;&lt; "EOF"
150<literal>define(`confMANGRP',`root')
151define(`confMANOWN',`root')
152define(`confSBINGRP',`root')
153define(`confUBINGRP',`root')
154define(`confUBINOWN',`root')</literal>
155EOF
156
157sed -i 's|/usr/man/man|/usr/share/man/man|' \
158 devtools/OS/Linux &amp;&amp;
159
160cd sendmail &amp;&amp;
161sh Build &amp;&amp;
162cd ../cf/cf &amp;&amp;
163cp generic-linux.mc sendmail.mc &amp;&amp;
164sh Build sendmail.cf</userinput></screen>
165
166 <para>
167 This package does not come with a test suite.
168 </para>
169
170 <para>
171 Now, as the <systemitem class="username">root</systemitem> user:
172 </para>
173
174<screen role="root"><userinput>install -v -d -m755 /etc/mail &amp;&amp;
175sh Build install-cf &amp;&amp;
176
177cd ../.. &amp;&amp;
178sh Build install &amp;&amp;
179
180install -v -m644 cf/cf/{submit,sendmail}.mc /etc/mail &amp;&amp;
181cp -v -R cf/* /etc/mail &amp;&amp;
182
183install -v -m755 -d /usr/share/doc/sendmail-&sendmail-version;/{cf,sendmail} &amp;&amp;
184
185install -v -m644 CACerts FAQ KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \
186 /usr/share/doc/sendmail-&sendmail-version; &amp;&amp;
187
188install -v -m644 sendmail/{README,SECURITY,TRACEFLAGS,TUNING} \
189 /usr/share/doc/sendmail-&sendmail-version;/sendmail &amp;&amp;
190
191install -v -m644 cf/README /usr/share/doc/sendmail-&sendmail-version;/cf &amp;&amp;
192
193for manpage in sendmail editmap mailstats makemap praliases smrsh
194do
195 install -v -m644 $manpage/$manpage.8 /usr/share/man/man8
196done &amp;&amp;
197
198install -v -m644 sendmail/aliases.5 /usr/share/man/man5 &amp;&amp;
199install -v -m644 sendmail/mailq.1 /usr/share/man/man1 &amp;&amp;
200install -v -m644 sendmail/newaliases.1 /usr/share/man/man1 &amp;&amp;
201install -v -m644 vacation/vacation.1 /usr/share/man/man1</userinput></screen>
202
203 <para>
204 Install the <application>sendmail</application> Installation and
205 Operations Guide with the following commands:
206 </para>
207
208 <note>
209 <para>
210 Remove <filename>op.pdf</filename> from the <command>make</command>
211 and <command>install</command> commands below if
212 you don't have <application>Ghostscript</application> installed.
213 </para>
214 </note>
215
216<screen remap="doc"><userinput>cd doc/op &amp;&amp;
217sed -i 's/groff/GROFF_NO_SGR=1 groff/' Makefile &amp;&amp;
218make op.txt op.pdf</userinput></screen>
219
220 <para>
221 Now, as the <systemitem class="username">root</systemitem> user:
222 </para>
223
224<screen role="root"
225 remap="doc"><userinput>install -v -d -m755 /usr/share/doc/sendmail-&sendmail-version; &amp;&amp;
226install -v -m644 op.ps op.txt op.pdf /usr/share/doc/sendmail-&sendmail-version; &amp;&amp;
227cd ../..</userinput></screen>
228
229 </sect2>
230
231 <sect2 role="commands">
232 <title>Command Explanations</title>
233
234 <para>
235 <command>cat &gt; devtools/Site/site.config.m4 &lt;&lt; "EOF"</command>:
236 This creates a configuration file changing some of the default settings.
237 </para>
238
239 <para>
240 <command>sed ... devtools/OS/Linux</command>: The site.config.m4
241 does not honor a change to the man directory, so fix it in the OS
242 definitions.
243 </para>
244
245 <para>
246 <command>sed ... include/sm/bdb.h</command>: This allows sendmail to
247 build properly with <xref linkend='db'/> versions 5 and above.
248 </para>
249
250 <para>
251 <command>sh Build; sh Build sendmail.cf; sh Build install-cf;
252 sh Build install</command>: <application>sendmail</application> uses an
253 <application>m4</application> based build script to create the various
254 <filename>Makefile</filename>s. These commands build and install the
255 package.
256 </para>
257
258 <para>
259 <command>for manpage in...;do...;done; install ...</command>: The man
260 pages are installed already formatted and <command>man</command> displays
261 them somewhat garbled. These commands replace the formatted pages with
262 pages <command>man</command> can display properly.
263 </para>
264
265 </sect2>
266
267 <sect2 role="configuration">
268 <title>Configuring sendmail</title>
269
270 <sect3 id="sendmail-config">
271 <title>Config Files</title>
272
273 <para>
274 <filename>/etc/mail/*</filename>
275 </para>
276
277 <indexterm zone="sendmail sendmail-config">
278 <primary sortas="e-etc-mail">/etc/mail/*</primary>
279 </indexterm>
280
281 </sect3>
282
283 <sect3>
284 <title>Configuration Information</title>
285
286 <note>
287 <para>
288 Ensure you have a fully qualified domain name defined
289 in <filename>/etc/hosts</filename> for your system before proceeding.
290 </para>
291 </note>
292
293 <para>
294 Create the <filename>/etc/mail/local-host-names</filename> and
295 <filename>/etc/mail/aliases</filename> files using the following
296 commands as the <systemitem class="username">root</systemitem> user:
297 </para>
298
299<screen role="root"><userinput>echo $(hostname) > /etc/mail/local-host-names
300cat &gt; /etc/mail/aliases &lt;&lt; "EOF"
301<literal>postmaster: root
302MAILER-DAEMON: root</literal>
303
304EOF
305newaliases</userinput></screen>
306
307 <para>
308 <application>sendmail</application>'s primary configuration file,
309 <filename>/etc/mail/sendmail.cf</filename>, is complex and not meant to
310 be directly edited. The recommended method for changing it is to modify
311 <filename>/etc/mail/sendmail.mc</filename> and various
312 <application>m4</application> files, then run the <command>m4</command>
313 macro processor from within
314 <filename class='directory'>/etc/mail</filename> as follows:
315 </para>
316
317<screen role="root"><userinput>cd /etc/mail &amp;&amp;
318m4 m4/cf.m4 sendmail.mc > sendmail.cf</userinput></screen>
319
320 <para>
321 A full explanation of the files to modify, and the available
322 parameters can be found in <filename>/etc/mail/README</filename>.
323 </para>
324
325 </sect3>
326
327 <sect3 id="sendmail-init">
328 <title><phrase revision="sysv">Boot Script</phrase>
329 <phrase revision="systemd">Systemd Unit</phrase></title>
330
331 <para>
332 To automate the running of <application>sendmail</application>
333 at startup, install the
334 <phrase revision="sysv"><filename>/etc/rc.d/init.d/sendmail</filename>
335 init script</phrase>
336 <phrase revision="systemd"><filename>sendmail.service</filename>
337 unit</phrase> included in the
338 <xref linkend="bootscripts" revision="sysv"/>
339 <xref linkend="systemd-units" revision="systemd"/> package:
340 </para>
341
342 <indexterm zone="sendmail sendmail-init">
343 <primary sortas="f-sendmail-init">sendmail</primary>
344 </indexterm>
345
346<screen role="root"><userinput>make install-sendmail</userinput></screen>
347
348 <note>
349 <para>
350 The -qNm option to <command>sendmail</command>, where N is number
351 of minutes, controls how often <application>sendmail</application>
352 will process the mail queue. A default of 5 minutes is used in the
353 <phrase revision="sysv">init script.</phrase>
354 <phrase revision="systemd">systemd unit.</phrase> Individual
355 workstation users may want to set this as low as 1 minute, large
356 installations handling more mail may want to set it higher.
357 </para>
358 </note>
359
360 </sect3>
361
362 </sect2>
363
364 <sect2 role="content">
365 <title>Contents</title>
366
367 <segmentedlist>
368 <segtitle>Installed Programs</segtitle>
369 <segtitle>Installed Libraries</segtitle>
370 <segtitle>Installed Directories</segtitle>
371
372 <seglistitem>
373 <seg>editmap, mailstats, makemap, praliases, sendmail, smrsh,
374 and vacation; symlinks to /usr/sbin/sendmail: hoststat, mailq,
375 newaliases, and purgestat</seg>
376 <seg>None</seg>
377 <seg>/etc/mail, /usr/share/doc/sendmail-&sendmail-version;,
378 /var/spool/mqueue, and /var/spool/clientmqueue</seg>
379 </seglistitem>
380 </segmentedlist>
381
382 <variablelist>
383 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
384 <?dbfo list-presentation="list"?>
385 <?dbhtml list-presentation="table"?>
386
387 <varlistentry id="editmap">
388 <term><command>editmap</command></term>
389 <listitem>
390 <para>
391 queries and edits <application>sendmail</application> map files.
392 </para>
393 <indexterm zone="sendmail editmap">
394 <primary sortas="b-editmap">editmap</primary>
395 </indexterm>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry id="hoststat">
400 <term><command>hoststat</command></term>
401 <listitem>
402 <para>
403 prints <application>sendmail</application>'s persistent host status.
404 </para>
405 <indexterm zone="sendmail hoststat">
406 <primary sortas="b-hoststat">hoststat</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 <varlistentry id="mailstats">
412 <term><command>mailstats</command></term>
413 <listitem>
414 <para>
415 displays <application>sendmail</application> statistics.
416 </para>
417 <indexterm zone="sendmail mailstats">
418 <primary sortas="b-mailstats">mailstats</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
422
423 <varlistentry id="mailq-sendmail">
424 <term><command>mailq</command></term>
425 <listitem>
426 <para>
427 prints a summary of outbound mail messages waiting for delivery.
428 </para>
429 <indexterm zone="sendmail mailq-sendmail">
430 <primary sortas="b-mailq">mailq</primary>
431 </indexterm>
432 </listitem>
433 </varlistentry>
434
435 <varlistentry id="makemap">
436 <term><command>makemap</command></term>
437 <listitem>
438 <para>
439 creates <application>sendmail</application> map files.
440 </para>
441 <indexterm zone="sendmail makemap">
442 <primary sortas="b-makemap">makemap</primary>
443 </indexterm>
444 </listitem>
445 </varlistentry>
446
447 <varlistentry id="newaliases-sendmail">
448 <term><command>newaliases</command></term>
449 <listitem>
450 <para>
451 rebuilds <filename>/etc/mail/aliases.db</filename> from the
452 contents of <filename>/etc/mail/aliases</filename>.
453 </para>
454 <indexterm zone="sendmail newaliases-sendmail">
455 <primary sortas="b-newaliases">newaliases</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry id="praliases">
461 <term><command>praliases</command></term>
462 <listitem>
463 <para>
464 displays current <application>sendmail</application> aliases.
465 </para>
466 <indexterm zone="sendmail praliases">
467 <primary sortas="b-praliases">praliases</primary>
468 </indexterm>
469 </listitem>
470 </varlistentry>
471
472 <varlistentry id="purgestat">
473 <term><command>purgestat</command></term>
474 <listitem>
475 <para>
476 causes <application>sendmail</application> to clear (purge)
477 all its host-status information.
478 </para>
479 <indexterm zone="sendmail purgestat">
480 <primary sortas="b-purgestat">purgestat</primary>
481 </indexterm>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry id="sendmail-prog-sendmail">
486 <term><command>sendmail</command></term>
487 <listitem>
488 <para>
489 is the <application>sendmail</application> mail transport agent.
490 </para>
491 <indexterm zone="sendmail sendmail-prog-sendmail">
492 <primary sortas="b-sendmail">sendmail</primary>
493 </indexterm>
494 </listitem>
495 </varlistentry>
496
497 <varlistentry id="smrsh">
498 <term><command>smrsh</command></term>
499 <listitem>
500 <para>
501 is a restricted shell for <application>sendmail</application>.
502 </para>
503 <indexterm zone="sendmail smrsh">
504 <primary sortas="b-smrsh">smrsh</primary>
505 </indexterm>
506 </listitem>
507 </varlistentry>
508
509 <varlistentry id="vacation-sendmail">
510 <term><command>vacation</command></term>
511 <listitem>
512 <para>
513 is an email auto responder.
514 </para>
515 <indexterm zone="sendmail vacation-sendmail">
516 <primary sortas="b-vacation">vacation</primary>
517 </indexterm>
518 </listitem>
519 </varlistentry>
520
521 </variablelist>
522
523 </sect2>
524
525</sect1>
Note: See TracBrowser for help on using the repository browser.