source: server/mail/postfix/postfix-config.xml@ 2277d1bb

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

server, gnome edits

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@868 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><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. The <filename>master.cf</filename> needs to be modified to prevent your machine from
28becoming a relay for unauthorized entities. All of these edits can be done
29with sed commands entered into the console with appropriate substitutions of
30your non-root login name for [user] and your fully qualified hostname for
31[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>
32
33<para><screen><userinput>cp /etc/aliases /etc/aliases.bak
34cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
35cp /etc/postfix/master.cf /etc/postfix/master.cf.bak
36sed "s/LOGIN/[user]/" /etc/aliases.bak > /etc/aliases
37sed "s/#myhostname = host.domain.tld/myhostname = \
38 [localhost.localdomain]/" \
39 /etc/postfix/main.cf.bak > /etc/postfix/main.cf
40/usr/bin/newaliases
41/usr/sbin/postfix start</userinput></screen></para></sect3>
42
43<sect3><title>postfix init.d script</title>
44
45<para>To automate the running of postfix, use following command to create the init.d script:</para>
46
47<para><screen><userinput>cat &gt; /etc/rc.d/init.d/postfix &lt;&lt; "EOF"</userinput>
48#!/bin/sh
49# Begin $rc_base/init.d/postfix
50
51# Based on sysklogd script from LFS-3.1 and earlier.
52# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
53
54source /etc/sysconfig/rc
55source $rc_functions
56
57case "$1" in
58
59 start)
60 echo "Starting Postfix..."
61 loadproc postfix start
62 ;;
63
64 stop)
65 echo "Stopping Postfix..."
66 loadproc postfix stop
67 ;;
68
69 reload)
70 echo "Reloading Postfix..."
71 loadproc postfix reload
72 ;;
73
74 restart)
75 $0 stop
76 sleep 1
77 $0 start
78 ;;
79
80 *)
81 echo "Usage: $0 {start|stop|reload|restart}"
82 exit 1
83 ;;
84esac
85
86# End $rc_base/init.d/postfix
87<userinput>EOF
88chmod 755 /etc/rc.d/init.d/postfix</userinput></screen></para>
89
90<para>Create the symbolic links to this file in the relevant
91<filename>rc.d</filename> 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.