source: server/mail/postfix/postfix-config.xml@ 896104b1

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 896104b1 was 896104b1, checked in by Billy O 'Connor <billyoc@…>, 21 years ago

General xml cleanup, <<'s, etc.

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

  • Property mode set to 100644
File size: 3.4 KB
Line 
1<sect2>
2<title>Configuring postfix</title>
3
4<sect3><title>Config files</title>
5<para><userinput>/etc/aliases, /etc/postfix/main.cf</userinput> and <userinput>/etc/postfix/master.cf</userinput></para>
6</sect3>
7
8<sect3><title>Configuration Information</title>
9
10<para><screen><userinput>cat &gt; /etc/aliases &lt;&lt; "EOF"</userinput>
11# Begin /etc/aliases
12
13MAILER-DAEMON: postmaster
14postmaster: root
15
16root: LOGIN
17# End /etc/aliases
18<userinput>EOF</userinput></screen></para>
19
20<para>The /etc/aliases file that was just created, the main.cf and the
21master.cf must be personalized for your system. The aliases file needs your
22non-root login identity so mail addressed to root can be forwarded to
23you at the user level. The main.cf file needs your fully qualified
24hostname. The master.cf needs to be modified to prevent your machine from
25becoming a relay for unauthorized entities. All of these edits can be done
26with sed commands entered into the console with appropriate substitutions of
27your non-root login name for [user] and your fully qualified hostname for
28[localhost.localdomain]. These edits will create a single host mail system,
29other edits are necessary to perform the many other functions available.
30You will find the main.cf file is self documenting, so load it into your editor to make the changes you need for your situation.</para>
31
32<para><screen><userinput>cp /etc/aliases /etc/aliases.bak
33cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
34cp /etc/postfix/master.cf /etc/postfix/master.cf.bak
35sed "s/LOGIN/[user]/" /etc/aliases.bak > /etc/aliases
36sed "s/#myhostname = host.domain.tld/myhostname = \
37 [localhost.localdomain]/" \
38 /etc/postfix/main.cf.bak > /etc/postfix/main.cf
39sed '/^smtp.*smtpd$/s/inet/unix/' /etc/postfix/master.cf.bak > \
40 /etc/postfix/master.cf
41/usr/bin/newaliases
42/usr/sbin/postfix start</userinput></screen></para></sect3>
43
44<sect3><title>postfix init.d script</title>
45
46<para>To automate the running of postfix, use following command to create the init.d script:</para>
47
48<para><screen><userinput>cat &gt; /etc/rc.d/init.d/postfix &lt;&lt; "EOF"</userinput>
49#!/bin/sh
50# Begin $rc_base/init.d/postfix
51
52# Based on sysklogd script from LFS-3.1 and earlier.
53# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
54
55source /etc/sysconfig/rc
56source $rc_functions
57
58case "$1" in
59
60 start)
61 echo "Starting Postfix..."
62 loadproc postfix start
63 ;;
64
65 stop)
66 echo "Stopping Postfix..."
67 loadproc postfix stop
68 ;;
69
70 reload)
71 echo "Reloading Postfix..."
72 loadproc postfix reload
73 ;;
74
75 restart)
76 $0 stop
77 sleep 1
78 $0 start
79 ;;
80
81 *)
82 echo "Usage: $0 {start|stop|reload|restart}"
83 exit 1
84 ;;
85esac
86
87# End $rc_base/init.d/postfix
88<userinput>EOF
89chmod 755 /etc/rc.d/init.d/postfix</userinput></screen></para>
90
91<para>Create the symbolic links to this file in the relevant rc.d directory with the following commands:
92
93<screen><userinput>cd /etc/rc.d/init.d &amp;&amp;
94ln -sf ../init.d/postfix ../rc0.d/K25postfix &amp;&amp;
95ln -sf ../init.d/postfix ../rc1.d/K25postfix &amp;&amp;
96ln -sf ../init.d/postfix ../rc2.d/K25postfix &amp;&amp;
97ln -sf ../init.d/postfix ../rc3.d/S35postfix &amp;&amp;
98ln -sf ../init.d/postfix ../rc4.d/S35postfix &amp;&amp;
99ln -sf ../init.d/postfix ../rc5.d/S35postfix &amp;&amp;
100ln -sf ../init.d/postfix ../rc6.d/K25postfix</userinput></screen></para>
101</sect3>
102
103</sect2>
Note: See TracBrowser for help on using the repository browser.