Hi,

I'm installing vpopmail on a new system, and I've got a question about SMTP
AUTH.  I want to allow selective relaying, and I can't use SMTP-after-POP
(and frankly, it strikes me as a hack, anyway).

I'm using the qmail-smtp-auth patch listed here:
http://www.qmail.org/netqmail/

I've installed qmail according to LWQ, which means that my qmail-smtpd
service runs as qmaild.nofiles which, in turn, means that vchkpw cannot
access the /home/vpopmail/domains directory.  My
/var/qmail/supervise/qmail-smtpd/run file is attached below.

Now, I've fixed it by making vchkpw setuid/setgid, as follows:

# chmod u+s /home/vpopmail/bin/vchkpw
# chmod g+s /home/vpopmail/bin/vchkpw

My question: is this the right thing to do?  Is there a better way to do
this?

Regards,
Roger.

---- /var/qmail/supervise/qmail-smtpd/run ----

#!/bin/sh

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ];
then
    echo QMAILDUID, NOFILESGID, MAXSMTPD or LOCAL is unset in
    echo /var/qmail/supervise/qmail-smtpd/run
    exit 1
fi

if [ ! -f /var/qmail/control/rcpthosts ]; then
    echo "No /var/qmail/control/rcpthosts!"
    echo "Refusing to start SMTP listener because it'll create an open
relay"
    exit 1
fi

exec /usr/local/bin/softlimit -m 3000000 \
    /usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb \
        -c "$MAXSMTPD" -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
        /var/qmail/bin/qmail-smtpd \
        /home/vpopmail/bin/vchkpw \
        /bin/true 2>&1

Reply via email to