68 lines
1.6 KiB
Bash
68 lines
1.6 KiB
Bash
#! /bin/sh
|
|
# $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.
|
|
#
|
|
# Modified by Silvan Calarco for QiLinux - silvan.calarco@qilinux.it
|
|
# 29-09-2003: added chkconfig support
|
|
#
|
|
# chkconfig: 2345 60 10
|
|
# description: Courier IMAP Server
|
|
#
|
|
|
|
prefix=/usr
|
|
exec_prefix=/usr
|
|
bindir=${exec_prefix}/bin
|
|
libexecdir=/usr/libexec/courier-imap
|
|
|
|
TLS_CACHEFILE=""
|
|
. /etc/imap/imapd-ssl
|
|
. /etc/imap/imapd
|
|
|
|
case $1 in
|
|
start)
|
|
LIBAUTHMODULES=""
|
|
for f in `echo $AUTHMODULES`
|
|
do
|
|
LIBAUTHMODULES="$LIBAUTHMODULES /usr/libexec/courier-imap/authlib/$f"
|
|
done
|
|
|
|
if test -x ${libexecdir}/authlib/authdaemond
|
|
then
|
|
/bin/env - ${libexecdir}/authlib/authdaemond start
|
|
fi
|
|
|
|
if test "$TLS_CACHEFILE" != ""
|
|
then
|
|
rm -f $TLS_CACHEFILE
|
|
fi
|
|
|
|
ulimit -v $IMAP_ULIMITD
|
|
/bin/env - /bin/sh -c " set -a ;
|
|
prefix=/usr ;
|
|
exec_prefix=/usr ;
|
|
bindir=${exec_prefix}/bin ;
|
|
libexecdir=/usr/libexec/courier-imap ;
|
|
. /etc/imap/imapd ; \
|
|
. /etc/imap/imapd-ssl ; \
|
|
IMAP_STARTTLS=$IMAPDSTARTTLS ; export IMAP_STARTTLS ; \
|
|
TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \
|
|
/usr/libexec/courier-imap/couriertcpd -address=$ADDRESS \
|
|
-stderrlogger=/usr/sbin/courierlogger \
|
|
-stderrloggername=imapd \
|
|
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
|
|
-pid=$PIDFILE $TCPDOPTS \
|
|
$PORT ${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES \
|
|
${exec_prefix}/bin/imapd Maildir"
|
|
;;
|
|
stop)
|
|
/usr/libexec/courier-imap/couriertcpd -pid=$PIDFILE -stop
|
|
if test -x ${libexecdir}/authlib/authdaemond
|
|
then
|
|
${libexecdir}/authlib/authdaemond stop
|
|
fi
|
|
;;
|
|
esac
|
|
exit 0
|