[5e54414] | 1 | <sect2>
|
---|
| 2 | <title>Configuring qmail</title>
|
---|
| 3 |
|
---|
| 4 | <sect3><title>Config files</title>
|
---|
| 5 | <para><userinput>/etc/inetd.conf and boot scripts</userinput></para>
|
---|
| 6 | </sect3>
|
---|
| 7 |
|
---|
| 8 | <sect3><title>Configuration Information</title>
|
---|
| 9 |
|
---|
[e61e34e] | 10 | <para>If inetd is used, the following command will add the qmaild
|
---|
| 11 | entry to <filename>/etc/inetd.conf</filename>: </para>
|
---|
| 12 |
|
---|
[5e54414] | 13 | <para><screen><userinput>
|
---|
[5f5a393] | 14 | echo "smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env \
|
---|
[5e54414] | 15 | tcp-env /var/qmail/bin/qmail-smtpd" >> /etc/inetd.conf
|
---|
| 16 | </userinput></screen></para>
|
---|
[f7f0d44] | 17 |
|
---|
[e61e34e] | 18 | <para>If xinetd is used, the following command will add the qmaild
|
---|
| 19 | entry to <filename>/etc/xinetd.conf</filename>: </para>
|
---|
| 20 |
|
---|
| 21 | <para><screen><userinput>
|
---|
| 22 | cat >> /etc/xinetd.conf << "EOF"
|
---|
| 23 | service smtp
|
---|
| 24 | {
|
---|
| 25 | disable = no
|
---|
| 26 | identifier = smtp-local
|
---|
| 27 | socket_type = stream
|
---|
| 28 | protocol = tcp
|
---|
| 29 | wait = no
|
---|
| 30 | user = qmaild
|
---|
| 31 | server = /var/qmail/bin/tcp-env
|
---|
| 32 | server_args = /var/qmail/bin/qmail-smtpd
|
---|
| 33 | env = RELAYCLIENT=
|
---|
| 34 | only_from = 127.0.0.1
|
---|
| 35 | log_on_failture += USERID
|
---|
| 36 | }
|
---|
| 37 | EOF
|
---|
| 38 | </userinput></screen></para>
|
---|
| 39 |
|
---|
[f7f0d44] | 40 | <para>To automate the running of qmail, use following command to
|
---|
| 41 | create the init.d script:</para>
|
---|
| 42 |
|
---|
| 43 | <para><screen><userinput>
|
---|
| 44 | cat > /etc/rc.d/init.d/qmail << "EOF"
|
---|
| 45 | #!/bin/sh
|
---|
| 46 | # Begin $rc_base/init.d/qmail
|
---|
| 47 |
|
---|
| 48 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 49 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 50 |
|
---|
| 51 | source /etc/sysconfig/rc
|
---|
| 52 | source $rc_functions
|
---|
| 53 |
|
---|
| 54 | case "$1" in
|
---|
| 55 |
|
---|
| 56 | start)
|
---|
| 57 | echo "Starting Qmail..."
|
---|
| 58 | /var/qmail/rc &
|
---|
| 59 | ;;
|
---|
| 60 |
|
---|
| 61 | stop)
|
---|
| 62 | echo "Stopping Qmail..."
|
---|
| 63 | killall qmail-send
|
---|
| 64 | ;;
|
---|
| 65 |
|
---|
| 66 | restart)
|
---|
| 67 | $0 stop
|
---|
| 68 | sleep 1
|
---|
| 69 | $0 start
|
---|
| 70 | ;;
|
---|
| 71 |
|
---|
| 72 | *)
|
---|
| 73 | echo "Usage: $0 {start|stop|restart}"
|
---|
| 74 | exit 1
|
---|
| 75 | ;;
|
---|
| 76 | esac
|
---|
| 77 |
|
---|
| 78 | # End $rc_base/init.d/qmail
|
---|
| 79 | EOF
|
---|
| 80 | chmod 755 /etc/rc.d/init.d/qmail</userinput></screen></para>
|
---|
| 81 |
|
---|
| 82 | <para>Create the symbolic links to this file in the relevant rc.d directory with the following commands:
|
---|
| 83 |
|
---|
| 84 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
| 85 | ln -sf ../init.d/qmail ../rc0.d/K25qmail &&
|
---|
| 86 | ln -sf ../init.d/qmail ../rc1.d/K25qmail &&
|
---|
| 87 | ln -sf ../init.d/qmail ../rc2.d/K25qmail &&
|
---|
| 88 | ln -sf ../init.d/qmail ../rc3.d/S35qmail &&
|
---|
| 89 | ln -sf ../init.d/qmail ../rc4.d/S35qmail &&
|
---|
| 90 | ln -sf ../init.d/qmail ../rc5.d/S35qmail &&
|
---|
| 91 | ln -sf ../init.d/qmail ../rc6.d/K25qmail</userinput></screen></para>
|
---|
| 92 |
|
---|
[5e54414] | 93 | </sect3>
|
---|
| 94 |
|
---|
| 95 | <sect3><title>Configuring mailers to work with qmail</title>
|
---|
| 96 | <para>Configuration information for some commonly used MUAs can be
|
---|
| 97 | found in the <filename>/var/qmail/doc/INSTALL.mbox</filename>
|
---|
| 98 | file. Most MUAs can be configured to use qmail Mailbox format buy
|
---|
| 99 | putting the following in ~/.profile:</para>
|
---|
| 100 | <para><screen><userinput>
|
---|
| 101 | MAIL=$HOME/Mailbox; export MAIL
|
---|
| 102 | </userinput></screen></para></sect3>
|
---|
| 103 |
|
---|
| 104 | </sect2>
|
---|