1 | <sect2>
|
---|
2 | <title>Configuring sendmail</title>
|
---|
3 |
|
---|
4 | <sect3><title>Config files</title>
|
---|
5 | <para><userinput>/etc/mail/aliases.db, /etc/mail/sendmail.cf,
|
---|
6 | /etc/mail/submit.cf</userinput> and
|
---|
7 | <userinput>/etc/mail/local-host-names</userinput></para>
|
---|
8 | </sect3>
|
---|
9 |
|
---|
10 | <sect3><title>Configuring sendmail</title>
|
---|
11 | <para><screen><userinput>
|
---|
12 | echo `hostname` > /etc/mail/local-host-names
|
---|
13 | cat > /etc/mail/aliases << "EOF"
|
---|
14 | postmaster: root
|
---|
15 | MAILER-DAEMON: root
|
---|
16 | EOF
|
---|
17 | cd /etc/mail &&
|
---|
18 | cp -R /usr/src/sendmail-&sendmail-version;/cf/* . &&
|
---|
19 | cp -R /usr/src/sendmail-&sendmail-version;/cf/cf/submit.mc . &&
|
---|
20 | cp -R /usr/src/sendmail-&sendmail-version;/cf/cf/sendmail.mc . &&
|
---|
21 | newaliases -v &&
|
---|
22 | </userinput></screen></para>
|
---|
23 |
|
---|
24 | <para>To start and stop sendmail on system boot/shutdown create the
|
---|
25 | sendmail boot script with the following commands: </para>
|
---|
26 |
|
---|
27 | <note><para>The -qNm option, where N is number of minutes, controls
|
---|
28 | how often Sendmail will process the mail queue. A default of 5
|
---|
29 | minutes is used here. Individual workstation users may want to set
|
---|
30 | this as low as 1 minute, large installations handling more mail will
|
---|
31 | want to set it higher.</para></note>
|
---|
32 |
|
---|
33 | <para><screen><userinput>cat > /etc/rc.d/init.d/sendmail << "EOF"</userinput>
|
---|
34 | #!/bin/sh
|
---|
35 | # Begin $rc_base/init.d/sendmail
|
---|
36 |
|
---|
37 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
38 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
39 |
|
---|
40 | source /etc/sysconfig/rc
|
---|
41 | source $rc_functions
|
---|
42 |
|
---|
43 | case "$1" in
|
---|
44 |
|
---|
45 | start)
|
---|
46 | echo "Starting sendmail..."
|
---|
47 | loadproc /usr/sbin/sendmail -bs -bd -q5m start
|
---|
48 | ;;
|
---|
49 |
|
---|
50 | stop)
|
---|
51 | echo "Stopping Sendmail..."
|
---|
52 | killproc sendmail
|
---|
53 | ;;
|
---|
54 |
|
---|
55 | status)
|
---|
56 | statusproc sendmail
|
---|
57 | ;;
|
---|
58 |
|
---|
59 | restart)
|
---|
60 | $0 stop
|
---|
61 | sleep 1
|
---|
62 | $0 start
|
---|
63 | ;;
|
---|
64 |
|
---|
65 | *)
|
---|
66 | echo "Usage: $0 {start|stop|status|restart}"
|
---|
67 | exit 1
|
---|
68 | ;;
|
---|
69 | esac
|
---|
70 |
|
---|
71 | # End $rc_base/init.d/sendmail
|
---|
72 | <userinput>EOF
|
---|
73 | chmod 755 /etc/rc.d/init.d/sendmail</userinput></screen></para>
|
---|
74 |
|
---|
75 | <para>Create the run level symlinks with the following commands:
|
---|
76 |
|
---|
77 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
78 | ln -sf ../init.d/sendmail ../rc0.d/K25sendmail &&
|
---|
79 | ln -sf ../init.d/sendmail ../rc1.d/K25sendmail &&
|
---|
80 | ln -sf ../init.d/sendmail ../rc2.d/K25sendmail &&
|
---|
81 | ln -sf ../init.d/sendmail ../rc3.d/S35sendmail &&
|
---|
82 | ln -sf ../init.d/sendmail ../rc4.d/S35sendmail &&
|
---|
83 | ln -sf ../init.d/sendmail ../rc5.d/S35sendmail &&
|
---|
84 | ln -sf ../init.d/sendmail ../rc6.d/K25sendmail</userinput></screen></para>
|
---|
85 | </sect3>
|
---|
86 |
|
---|
87 | </sect2>
|
---|