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