tomclegg.net


Diary
Examples
Hire Tom
Mostly Mozart
Patches
School
Scrapbook
Software
    allaboutme
    byteswap
  >checksocks<
    djbdns-ipv6
    dsprec
    fresnel
    fresnel
    logger
    mail-transport-agent
    maildirpop3d
    mp3cat
    qmail-bmf-wildcard
    rawrms
    stationbreak
Telephones




colocation
comments
davidireland
edsgranola
faq
funsites
goodlooking
goodmovies
google-earth-saucy-amd64
houserules
liberating
resume
resume2
scratch
shopping
snacks
todo
university
warisbogus

Check for open SOCKS proxy
Posted December 11, 2003

Check whether an SMTP client is an open SOCKS proxy before accepting mail from it.

Here is the checksocks program.

#!/bin/sh
if tcpclient -T 3 "$TCPREMOTEIP" 1080 true 2>/dev/null >/dev/null
then
  export RBLSMTPD="Port 1080 open at $TCPREMOTEIP"
fi
eval "exec $*"

To use it, include it somewhere between tcpserver and rblsmtpd in your qmail-smtpd invocation. For example:

tcpserver -x tcp.smtpd.cdb \
 -vR -u 82 -g 81 -l `hostname` 10.1.2.3 smtp \
 ./checksocks \
 rblsmtpd -a antirbl.tomclegg.net \
 qmail-smtpd `hostname` /usr/local/sbin/cmd5checkpw /usr/bin/true \
 2>&1