source: server/mail/postfix/postfix-config.xml@ eccde83

10.0 10.1 11.0 11.1 11.2 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 krejzi/svn lazarus nosym perl-modules plabs/python-mods qt5new systemd-11177 systemd-13485 trunk upgradedb v5_1 v5_1-pre1 xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since eccde83 was eccde83, checked in by Larry Lawrence <larry@…>, 19 years ago

update to postfix-2.0.18

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

  • Property mode set to 100644
File size: 3.7 KB
Line 
1<sect2>
2<title>Configuring <application>Postfix</application></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<screen><userinput><command>cat &gt; /etc/aliases &lt;&lt; "EOF"</command>
13# Begin /etc/aliases
14
15MAILER-DAEMON: postmaster
16postmaster: root
17
18root: LOGIN
19# End /etc/aliases
20<command>EOF</command></userinput></screen>
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
25needs your non-root login identity so mail addressed to root can be forwarded
26to you at the user level. The <filename>main.cf</filename> file needs your
27fully qualified hostname. All of these edits can be done with sed commands
28entered into the console with appropriate substitutions of your non-root
29login name for <replaceable>[user]</replaceable> and your fully qualified
30hostname for <replaceable>[localhost.localdomain]</replaceable>. You will
31find the <filename>main.cf</filename> file
32is self documenting, so load it into your editor to make the changes you need
33for your situation.</para>
34
35<screen><userinput><command>cp /etc/aliases /etc/aliases.bak
36cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
37cp /etc/postfix/master.cf /etc/postfix/master.cf.bak
38sed "s/LOGIN/<replaceable>[user]</replaceable>/" /etc/aliases.bak > /etc/aliases
39sed "s/#myhostname = host.domain.tld/myhostname = \
40 <replaceable>[localhost.localdomain]</replaceable>/" \
41 /etc/postfix/main.cf.bak > /etc/postfix/main.cf
42/usr/bin/newaliases
43/usr/sbin/postfix start</command></userinput></screen></sect3>
44
45<sect3><title>Postfix init.d script</title>
46
47<para>To automate the running of Postfix, use following command to create the init.d script:</para>
48
49<screen><userinput><command>cat &gt; /etc/rc.d/init.d/postfix &lt;&lt; "EOF"</command>
50#!/bin/sh
51# Begin $rc_base/init.d/postfix
52
53# Based on sysklogd script from LFS-3.1 and earlier.
54# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
55
56source /etc/sysconfig/rc
57source $rc_functions
58
59case "$1" in
60
61 start)
62 echo "Starting Postfix..."
63 loadproc postfix start
64 ;;
65
66 stop)
67 echo "Stopping Postfix..."
68 loadproc postfix stop
69 ;;
70
71 reload)
72 echo "Reloading Postfix..."
73 loadproc postfix reload
74 ;;
75
76 abort)
77 echo "Aborting Postfix..."
78 loadproc postfix abort
79 ;;
80
81 flush)
82 echo "Flushing Postfix..."
83 loadproc postfix flush
84 ;;
85
86 check)
87 echo "Checking Postfix..."
88 loadproc postfix check
89 ;;
90
91 restart)
92 $0 stop
93 sleep 1
94 $0 start
95 ;;
96
97 *)
98 echo "Usage: $0 {start|stop|reload|abort|flush|check|restart}"
99 exit 1
100 ;;
101esac
102
103# End $rc_base/init.d/postfix
104<command>EOF
105chmod 755 /etc/rc.d/init.d/postfix</command></userinput></screen>
106
107<para>Create the symbolic links to this file in the relevant
108<filename>rc.d</filename> directory with the following commands:</para>
109
110<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
111ln -sf ../init.d/postfix ../rc0.d/K25postfix &amp;&amp;
112ln -sf ../init.d/postfix ../rc1.d/K25postfix &amp;&amp;
113ln -sf ../init.d/postfix ../rc2.d/K25postfix &amp;&amp;
114ln -sf ../init.d/postfix ../rc3.d/S35postfix &amp;&amp;
115ln -sf ../init.d/postfix ../rc4.d/S35postfix &amp;&amp;
116ln -sf ../init.d/postfix ../rc5.d/S35postfix &amp;&amp;
117ln -sf ../init.d/postfix ../rc6.d/K25postfix</command></userinput></screen>
118</sect3>
119
120</sect2>
Note: See TracBrowser for help on using the repository browser.