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