#!/bin/sh
if [ $# -lt 2 ]; then
	echo "usage: $0 local-host remote-host [options]"
	echo "  All options are passed directly to tcpserver."
	exit 1
fi
prefix=`dirname $0`
localhost=$1
remotehost=$2
shift 2
exec envuidgid nobody \
tcpserver -HRUllocalhost "$@" $localhost 110 \
	sh -c "exec tcpclient -HRllocalhost $remotehost 110 \
	$prefix/ucspi-proxy-pop3-relay \$TCPREMOTEIP \
	300 /usr/sbin/relay-ctrl-allow /bin/true"
