5 # description: IMAP Daemon
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
14 [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap
16 # Check that networking is up.
17 if [ "${NETWORKING}" = "no" ]; then
18 nls "WARNING: Networking is down. IMAP service can't be runed."
23 # See how we were called.
26 # Check if the service is already running?
27 if [ ! -f /var/lock/subsys/courier-imap ]; then
28 show Starting IMAP Daemon
32 for f in `echo $AUTHMODULES`; do
33 LIBAUTHMODULES="$LIBAUTHMODULES /usr/lib/courier-imap/$f"
36 /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
37 -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
38 -pid=/var/run/imapd.pid -stderrlogger=/usr/lib/courier-imap/logger \
39 -forcebind -nodnslookup -noidentlookup $PORT \
40 /usr/bin/imaplogin $LIBAUTHMODULES /usr/bin/imapd $MAILDIR &
42 if ps ax | grep -v grep | grep -q couriertcpd; then
48 nls "IMAP already is running\n"
50 touch /var/lock/subsys/courier-imap
53 show Stopping IMAP Daemon
55 rm -f /var/run/imapd.pid
56 rm -f /var/lock/subsys/courier-imap
66 nls "Usage: $0 {start|stop|restart|reload|status}"