PLEASE note that I am not a subscriber to this list, if you need to ask me
any questions about this, remember to cc me.

Quoted from mail-archive.com:
on 8/29/01 11:50 AM, [EMAIL PROTECTED] at [EMAIL PROTECTED] spake:

> Latest CourierIMAP works with the latest development of
> vpopmail which has authentication structure changes.

Except for IMAP before SMTP (roaming users).

My previous posts:

http://www.mail-archive.com/vchkpw@inter7.com/msg06208.html
http://www.mail-archive.com/vchkpw@inter7.com/msg06246.html

No one has responded to these posts, so either I'm the only one using this
feature with these versions, or the only one that is having the problem.
I'd love to know if someone else has it working successfully with
4.10.35/1.3.10.

Cheers,

Bill Shupp


Bill, I took a crack at your roaming users problem last night and I came
up with a solution that I'm happy with.

The basic problem is that the newer version of courierIMAP has seperated
the authentication process from the couriertcp process by using
authdaemond. So when vpopmail's open_smtp_relay function get's called it's
unable to retreive the remote user's IP address from the environment
variables. To fix this I've written a program that can be dropped in
between imaplogin and imapd. This program will only be called if the user
has been authenticated. It will call open_smtp_relay with the proper
environment variables set, then it will call whatever program is passed
into it's argv[1] parameter.

Run sh ./build to build open_relay, if the compile fails with complaints
about crypt add -lcrypt to your ~vpopmail/etc/lib_deps. Install open_relay
whereever you like, I put mine in /usr/local/bin. Modify imapd.rc, or use
the one I attached. The important line is this one:

    $PORT ${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES \
     ${exec_prefix}/bin/open_relay \ #This will setup open_relay for roaming users
     ${exec_prefix}/bin/imapd Maildir"

Don't forget to put ~vpopmail/bin/clearopensmtp into your cron!

Enjoy,
Chris
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include "vpopmail.h"

int main(int argc, char *argv[])
{
fprintf(stderr, "INFO:Opening smtp relay for ip [%s]\n", getenv("TCPREMOTEIP"));
open_smtp_relay();
/*fprintf(stderr, "INFO:Executing %s\n", argv[1]);*/
execv(argv[1], argv+1);
fprintf(stderr, "INFO:Should never get here.\n");
return 0;
}
#! /bin/sh
# $Id: imapd.rc.in,v 1.18 2001/07/30 00:02:32 mrsam Exp $
#
# Copyright 1998 - 2000 Double Precision, Inc.
# See COPYING for distribution information.


prefix=/usr/local
exec_prefix=/usr/local
bindir=${exec_prefix}/bin
libexecdir=/usr/local/libexec

. ${prefix}/etc/imapd-ssl
. ${prefix}/etc/imapd

case $1 in
start)
        LIBAUTHMODULES=""
        for f in `echo $AUTHMODULES`
        do
                LIBAUTHMODULES="$LIBAUTHMODULES /usr/local/libexec/authlib/$f"
        done

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

        ulimit -d $IMAP_ULIMITD
        /usr/bin/env - /bin/sh -c " . ${prefix}/etc/imapd ; \
                                . ${prefix}/etc/imapd-ssl ; \
                IMAP_STARTTLS=$IMAPDSTARTTLS ; export IMAP_STARTTLS ; \
                TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \
                `sed -n '/^#/d;/=/p' <${prefix}/etc/imapd | \
                        sed 's/=.*//;s/^/export /;s/$/;/'`
                `sed -n '/^#/d;/=/p' <${prefix}/etc/imapd-ssl | \
                        sed 's/=.*//;s/^/export /;s/$/;/'`
                /usr/local/libexec/couriertcpd -address=$ADDRESS \
                        -stderrlogger=/usr/local/libexec/logger \
                        -stderrloggername=imapd \
                        -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
                        -pid=$PIDFILE $TCPDOPTS \
                        $PORT ${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES \
                                ${exec_prefix}/bin/open_relay \
                                ${exec_prefix}/bin/imapd Maildir"
        ;;
stop)
        /usr/local/libexec/couriertcpd -pid=$PIDFILE -stop
        if test -x ${libexecdir}/authlib/authdaemond
        then
                ${libexecdir}/authlib/authdaemond stop
        fi
        ;;
esac
exit 0
gcc -o open_relay open_relay.c `cat ~vpopmail/etc/*deps`

Reply via email to