Hello!

I want to use daemontools to supervise courier imap. IMAP with daemontools
and sysvinit from courier works fine, but IMAP over SSL doesn't work well
with daemontools:

imap over ssl with sysvinit: fine

imap over ssl with daemontools: error
error messages are:
    starttls: accept: error:00000000:lib(0):func(0):reason(0)
or:
    starttls: accept: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong
version number

imap over ssl with sysvinit, login with email client, stopping imap with
sysvinit and then starting imap over ssl with daemontools: works fine

I think, there is a problem with the ssl handshake. I tested with M$ Outlook
and stunnel -c -f -r imaps, both failed with imap over ssl with daemontools.

My supervise script for imap over ssl:
--- cut ---
#!/bin/sh
exec 2>&1

MAILDIR=".Maildir"

# location of courier-imap
prefix="/usr/lib/courier-imap"
exec_prefix="/usr/lib/courier-imap"
bindir="/usr/lib/courier-imap/bin"
libexecdir="/usr/lib/courier-imap/libexec"

# load configuration files
. /etc/imap/imapd-ssl
. /etc/imap/imapd

IMAP_ULIMITD=$(($IMAP_ULIMITD*1024))
IMAP_STARTTLS=${IMAPDSTARTTLS}; export IMAP_STARTTLS;
IMAP_TLS="1"; export IMAP_TLS;
TLS_PROTOCOL=${TLS_STARTTLS_PROTOCOL};

`sed -n '/^#/d;/=/p' </etc/imap/imapd | \
    sed 's/=.*//;s/^/export /;s/$//';
sed -n '/^#/d;/=/p' </etc/imap/imapd-ssl | \
    sed 's/=.*//;s/^/export /;s/$//'`

LIBAUTHMODULES=""
for f in `echo $AUTHMODULES`; do
    LIBAUTHMODULES="$LIBAUTHMODULES
/usr/lib/courier-imap/libexec/authlib/$f"
done

if test -x ${libexecdir}/authlib/authdaemond; then
    /usr/bin/env - ${libexecdir}/authlib/authdaemond start
fi

exec /service/bin/softlimit -d${IMAP_ULIMITD} \
    /usr/local/bin/tcpserver -c${MAXDAEMONS} -v -H -R ${SSLADDRESS}
${SSLPORT} \
        ${exec_prefix}/bin/couriertls -server -tcpd \
        ${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES \
        ${exec_prefix}/bin/imapd ${MAILDIR} 2>&1
--- cut ---

I'm using courier-imap 1.4.5, openssl 0.9.6b with rc5 and daemontools 0.76
on SuSe 7.3

Christian


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to