qmail の起動

投稿日:

いつも忘れるので、VineLinux2.6r4用の/etc/rc.d/init.d/qmail の中身を保存。

#!/bin/sh
RELAY_CTRL_DIR=/etc/relay-ctrl/RELAY_CTRL_DIR
export RELAY_CTRL_DIR
exec env - PATH="/var/qmail/bin:$PATH"
qmail-start ./Maildir/ splogger qmail &
# Start smtpd
/usr/local/bin/envdir /etc/relay-ctrl
/usr/bin/relay-ctrl-chdir
/usr/local/bin/tcpserver -HR -v -u qmaildのUID
-g nofilesのGID  0 smtp
/usr/bin/relay-ctrl-check
/var/qmail/bin/qmail-smtpd 2>&1 | /var/qmail/bin/splogger smtpd 3 &
# Start pop3d
/usr/local/bin/envdir /etc/relay-ctrl
/usr/bin/relay-ctrl-chdir
/usr/local/bin/tcpserver -HR -v 0 pop3
/var/qmail/bin/qmail-popup ホスト@ドメイン名
/bin/checkpassword
/usr/bin/relay-ctrl-allow
/var/qmail/bin/qmail-pop3d Maildir 2>&1 | /var/qmail/bin/splogger pop3d 3 &

/usr/libexec/courier-imap/imapd.rcの中身

#! /bin/sh -x
# $Id: imapd.rc.in,v 1.22 2002/12/24 02:31:40 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
# See COPYING for distribution information.
prefix=/usr
exec_prefix=/usr
bindir=/usr/sbin
libexecdir=/usr/libexec/courier-imap
RELAY_CTRL_DIR=/var/spool/relay-ctrl/allow
export RELAY_CTRL_DIR
TLS_CACHEFILE=""
. /etc/courier-imap/imapd-ssl
. /etc/courier-imap/imapd
case $1 in
start)
        LIBAUTHMODULES=""
        for f in `echo $AUTHMODULES`
        do
                LIBAUTHMODULES="$LIBAUTHMODULES ${libexecdir}/authlib/$f"
        done
        if test -x ${libexecdir}/authlib/authdaemond
        then
                /usr/bin/env - ${libexecdir}/authlib/authdaemond start
        fi
        if test "$TLS_CACHEFILE" != ""
        then
                rm -f $TLS_CACHEFILE
        fi
        ulimit -v $IMAP_ULIMITD
        /usr/bin/env - /bin/sh -c " set -a ;
                        prefix=/usr ;
                        exec_prefix=/usr ;
                        bindir=/usr/sbin ;
                        libexecdir=/usr/libexec/courier-imap ;
                                . /etc/courier-imap/imapd ;
                                . /etc/courier-imap/imapd-ssl ;
                        IMAP_STARTTLS=$IMAPDSTARTTLS ; export IMAP_STARTTLS ;
                        TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ;
                        /usr/local/bin/envdir /etc/relay-ctrl
                        /usr/bin/relay-ctrl-chdir
                        ${libexecdir}/couriertcpd -address=$ADDRESS
                        -stderrlogger=${libexecdir}/courierlogger
                        -stderrloggername=imapd
                        -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP
                        -pid=$PIDFILE $TCPDOPTS
                        $PORT /usr/sbin/imaplogin $LIBAUTHMODULES
                        /usr/bin/relay-ctrl-allow 
                                /usr/sbin/imapd Maildir"
        ;;
stop)
        ${libexecdir}/couriertcpd -pid=$PIDFILE -stop
        if test -x ${libexecdir}/authlib/authdaemond
        then
                ${libexecdir}/authlib/authdaemond stop
        fi
        ;;
esac
exit 0

imap-sslとcourierのpop3dを使用しない場合、以下のように設定しておく。

/etc/courier-imap/imapd-ssl->IMAPDSSLSTART=NO
/etc/courier-imap/pop3d ->POP3DSTART=NO
/etc/courier-imap/pop3d-ssl -> POP3DSSLSTART=NO