tomclegg.net


Diary
Examples
    256-router
    adzap
    apache-double-reverse
    cacti-adodb-php4
    debian-quota
    diskonmodule
    dollarsperbyte
    dynip
    ezmlm-linux
    fbsdhabits
    freebsdclone
    macbook-quantal-sound
    maildirpop3d-awfulhak
    mandy
    md
    mrtg
    net-snmp
    nodefaultroute
    oracle9i
    oracle9i-bsd5
    oracle9i-client
    oracle9i-nat
    php-cgi
    php-commandline
    php-image
    php-kics
    php-mini_httpd
    pinouts
    pizzaperdollar
    plesk-symlink-php
    pxe
    qmail-linux
    qmail-qfilter
    racoon-sonicwall
    redundant-vpn
    rewriterule
    seahorse-workaround
    setting-locale-failed
    smalldog
    snmpv3-cacti
    spamassassin
    squid-tproxy
    supfile
    suse73
    svc-nmbd
    svc-smbd
  >svc-smtpd<
    switch-virtualbox-virsh
    toyotastereo
    vm
    vn-file
    wmp-invalid
    xcode-remote-install
    xen-eth0-renamed
    xen-monowall
    xen3-ubuntu-dapper
    zz-update-grub-fail
Hire Tom
Mostly Mozart
Patches
School
Scrapbook
Software
Telephones




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

supervise tcpserver qmail-smtpd
Posted May 18, 2003
cd /var/service
mkdir smtpd
cd smtpd
chmod +t .
mkdir log
echo :allow >tcprules
perl -e 'print "tcprules.cdb:\n"' >Makefile
perl -e 'print "\ttcprules tcprules.cdb tcprules.tmp <tcprules\n"' >>Makefile
make
cat <<'EOF' >run
#!/bin/sh

PATH=/bin:/usr/bin:/usr/local/bin:/var/qmail/bin
export PATH

if [ -x /usr/local/sbin/cmd5checkpw ]
then
  smtpd="qmail-smtpd `hostname` /usr/local/sbin/cmd5checkpw /usr/bin/true"
else
  smtpd=qmail-smtpd
fi

exec envuidgid qmaild tcpserver \
 -x tcprules.cdb \
 -vRU -l `hostname` 0 smtp \
 recordio \
 rblsmtpd -c \
 -a antirbl.tomclegg.net \
 -r rbl.tomclegg.net \
 rblsmtpd \
 -r relays.ordb.org \
 -r bl.spamcop.net \
 -r opm.blitzed.org \
 $smtpd \
 2>&1
EOF
cat <<'EOF' >log/run
#!/bin/sh

PATH=/bin:/usr/bin:/usr/local/bin:/var/qmail/bin
export PATH

exec setuidgid qmaill multilog t s999999 \
 '-*' \
 '+* tcpserver: *' \
 '+* rblsmtpd: *' \
 '+* * > *' \
 '+*< RCPT *' '+*< Rcpt *' '+*< rcpt *' \
 '+*< MAIL F*' '+*< MAIL f*' '+*< Mail F*' '+*< Mail f*' '+*< mail F*' '+*< mail f*' \
 ./main

EOF
chmod +x run log/run
mkdir log/main
chown qmaill log/main

cd /service
ln -s /var/service/smtpd
sleep 7
svstat /service/smtpd /service/smtpd/log