qmail-smtpd hangs when enabling logging/debug from any checkpw compatible scripts

Glover George <[email protected]> Sat, 17 May 2014 21:17:33 -0500
Newsgroups gmane.comp.djb.checkpassword
Message-ID <CAO9ThFgdG1cqUU-NdGXXsZwrtW8T=RCWc5D-FDRnU4yr5im22Q@mail.gmail.com>
--047d7bd6ba7012d86504f9a34166
Content-Type: text/plain; charset=UTF-8

Hi all,

We've been using qmail for nearly 10 years without having to touch it very
often and it's been great.   However, we recently have had the need to see
who is authenticating via smtp in order to track down an abusive user.

Forgive me if this isn't the right place to ask, but I thought this might
be a good place to start.

We normally use ldap_auth.pl (http://www.apecity.com/qmail/ldap_auth.html),
but we have also tried checkpassword-pam and several others.

As long as we don't enable any output from these modules, everything works
fine.  The moment we try to turn on logging (which is supposed to append
the information to /var/log/qmail/qmail-smtp/current), we can no longer
send email through the server.  There are no error messages in any relevant
files.  Just an error message that comes back from thunderbird to the
effect of error sending message.

I'm pasting the relevant qmail-smtp run file.  Any suggestions are
appreciated.

Cheers.

#!/bin/sh

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue" ; export QMAILQUEUE
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
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 60000000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp587.cdb -c
"$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 587 \
/var/qmail/bin/qmail-smtpd m <http://catfish.computing.usm.edu>
ymailserver.bla.com \
/usr/bin/chkpassldap.pl /bin/true 2>&1

--047d7bd6ba7012d86504f9a34166
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>We&#39;ve been using qmail for =
nearly 10 years without having to touch it very often and it&#39;s been gre=
at. =C2=A0 However, we recently have had the need to see who is authenticat=
ing via smtp in order to track down an abusive user. =C2=A0</div>





<div><br></div><div>Forgive me if this isn&#39;t the right place to ask, bu=
t I thought this might be a good place to start. =C2=A0</div><div><br></div=
><div>We normally use <a href=3D"http://ldap_auth.pl" target=3D"_blank">lda=
p_auth.pl</a> (<a href=3D"http://www.apecity.com/qmail/ldap_auth.html" targ=
et=3D"_blank">http://www.apecity.com/qmail/ldap_auth.html</a>), but we have=
 also tried checkpassword-pam and several others.=C2=A0</div>




<div><br></div><div>As long as we don&#39;t enable any output from these mo=
dules, everything works fine. =C2=A0The moment we try to turn on logging (w=
hich is supposed to append the information to /var/log/qmail/qmail-smtp/cur=
rent), we can no longer send email through the server. =C2=A0There are no e=
rror messages in any relevant files. =C2=A0Just an error message that comes=
 back from thunderbird to the effect of error sending message.</div>




<div><br></div><div>I&#39;m pasting the relevant qmail-smtp run file. =C2=
=A0Any suggestions are appreciated.</div><div><br></div><div>Cheers.</div><=
div>
<p>#!/bin/sh<br><br>QMAILQUEUE=3D&quot;/var/qmail/bin/qmail-scanner-queue&q=
uot; ; export QMAILQUEUE<br>QMAILDUID=3D`id -u vpopmail`<br>NOFILESGID=3D`i=
d -g vpopmail`<br>MAXSMTPD=3D`cat /var/qmail/control/concurrencyincoming`<b=
r>
LOCAL=3D`head -1 /var/qmail/control/me`<br>if [ -z &quot;$QMAILDUID&quot; -=
o -z &quot;$NOFILESGID&quot; -o -z &quot;$MAXSMTPD&quot; -o -z &quot;$LOCAL=
&quot; ]; then<br>echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset i=
n<br>




echo /var/qmail/supervise/qmail-smtpd/run<br>exit 1<br>fi<br>if [ ! -f /var=
/qmail/control/rcpthosts ]; then<br>echo &quot;No /var/qmail/control/rcptho=
sts!<br>echo &quot;Refusing to start SMTP listener because it&#39;ll create=
 an open relay&quot;<br>




exit 1<br>fi<br>exec /usr/local/bin/softlimit -m 60000000 \<br>/usr/local/b=
in/tcpserver -v -R -l &quot;$LOCAL&quot; -x /etc/tcp.smtp587.cdb -c &quot;$=
MAXSMTPD&quot; \<br>-u &quot;$QMAILDUID&quot; -g &quot;$NOFILESGID&quot; 0 =
587 \<br>




/var/qmail/bin/qmail-smtpd <a href=3D"http://catfish.computing.usm.edu" tar=
get=3D"_blank">m</a><a href=3D"http://ymailserver.bla.com" target=3D"_blank=
">ymailserver.bla.com</a>=C2=A0\<br>/usr/bin/<a href=3D"http://chkpassldap.=
pl" target=3D"_blank">chkpassldap.pl</a> /bin/true 2&gt;&amp;1=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>




</p></div></div>

--047d7bd6ba7012d86504f9a34166--