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