source: server/mail/postfix/postfix-config.xml@ 064db32a

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 064db32a was ca2217b, checked in by Larry Lawrence <larry@…>, 21 years ago

basicnet, server, content, x

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

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