Configuring qmail
Config files
/etc/inetd.conf and boot scripts
Configuration Information
If inetd is used, the following command will add the qmaild
entry to /etc/inetd.conf:
echo "smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env \
tcp-env /var/qmail/bin/qmail-smtpd" >> /etc/inetd.conf
If xinetd is used, the following command will add the qmaild
entry to /etc/xinetd.conf:
cat >> /etc/xinetd.conf << "EOF"
service smtp
{
disable = no
identifier = smtp-local
socket_type = stream
protocol = tcp
wait = no
user = qmaild
server = /var/qmail/bin/tcp-env
server_args = /var/qmail/bin/qmail-smtpd
env = RELAYCLIENT=
only_from = 127.0.0.1
log_on_failture += USERID
}
EOF
To automate the running of qmail, use following command to
create the init.d script:
cat > /etc/rc.d/init.d/qmail << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/qmail
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
start)
echo "Starting Qmail..."
/var/qmail/rc &
;;
stop)
echo "Stopping Qmail..."
killall qmail-send
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
# End $rc_base/init.d/qmail
EOF
chmod 755 /etc/rc.d/init.d/qmail
Create the symbolic links to this file in the relevant
rc.d directory with the following commands:
cd /etc/rc.d/init.d &&
ln -sf ../init.d/qmail ../rc0.d/K25qmail &&
ln -sf ../init.d/qmail ../rc1.d/K25qmail &&
ln -sf ../init.d/qmail ../rc2.d/K25qmail &&
ln -sf ../init.d/qmail ../rc3.d/S35qmail &&
ln -sf ../init.d/qmail ../rc4.d/S35qmail &&
ln -sf ../init.d/qmail ../rc5.d/S35qmail &&
ln -sf ../init.d/qmail ../rc6.d/K25qmail
Configuring mailers to work with qmail
Configuration information for some commonly used MUAs can be
found in the /var/qmail/doc/INSTALL.mbox
file. Most MUAs can be configured to use qmail Mailbox format buy
putting the following in ~/.profile:
MAIL=$HOME/Mailbox; export MAIL