#!/bin/sh -e # WARNING: This is still untested. if [ -f /usr/sbin/sendmail -a ! -h /usr/sbin/sendmail ] then original=/usr/sbin/sendmail elif [ -f /usr/lib/sendmail -a ! -h /usr/lib/sendmail ] then original=/usr/lib/sendmail else exit 1 fi mta=/etc/mta umask 077 [ -d /usr/lib/mta ] || mkdir /usr/lib/mta mkdir /usr/lib/mta/sendmail ln -s /usr/lib/mta/sendmail $mta cp -p $original $mta/send cp -p /bin/rmail $mta/rmail echo '#!/bin/sh exec sendmail -bp' > $mta/showqueue echo '#!/bin/sh exec sendmail -q' > $mta/runqueue echo '#!/bin/sh exec sendmail -bh' > $mta/showfailures echo '#!/bin/sh exec sendmail -bH' > $mta/clearfailures echo '#!/bin/sh exec sendmail -bi' > $mta/newaliases echo '#!/bin/sh exec sendmail -bd -q15m' > $mta/start echo '#!/bin/sh echo Manually kill sendmail and wait for its children to die.' > $mta/stop echo '#!/bin/sh echo Manually kill -HUP sendmail.' > $mta/newconf chmod 755 $mta/showqueue $mta/runqueue chmod 755 $mta/showfailures $mta/clearfailures chmod 755 $mta/newaliases $mta/start $mta/stop chmod 755 $mta x=/bin/rmail; [ -f $x ] && (rm -f $x; ln -s $mta/rmail $x) x=/usr/sbin/sendmail; [ -f $x ] && (rm -f $x; ln -s $mta/send $x) x=/usr/lib/sendmail; [ -f $x ] && (rm -f $x; ln -s $mta/send $x) x=/usr/bin/mailq; [ -f $x ] && (rm -f $x; ln -s $mta/showqueue $x) x=/usr/sbin/mailq; [ -f $x ] && (rm -f $x; ln -s $mta/showqueue $x) x=/usr/ucb/mailq; [ -f $x ] && (rm -f $x; ln -s $mta/showqueue $x) x=/usr/bsd/mailq; [ -f $x ] && (rm -f $x; ln -s $mta/showqueue $x) x=/usr/lib/mailq; [ -f $x ] && (rm -f $x; ln -s $mta/showqueue $x) x=/usr/bin/newaliases; [ -f $x ] && (rm -f $x; ln -s $mta/newaliases $x) x=/usr/sbin/newaliases; [ -f $x ] && (rm -f $x; ln -s $mta/newaliases $x) x=/usr/ucb/newaliases; [ -f $x ] && (rm -f $x; ln -s $mta/newaliases $x) x=/usr/bsd/newaliases; [ -f $x ] && (rm -f $x; ln -s $mta/newaliases $x) x=/usr/lib/newaliases; [ -f $x ] && (rm -f $x; ln -s $mta/newaliases $x) x=/usr/bin/hoststat; [ -f $x ] && (rm -f $x; ln -s $mta/showfailures $x) x=/usr/sbin/hoststat; [ -f $x ] && (rm -f $x; ln -s $mta/showfailures $x) x=/usr/ucb/hoststat; [ -f $x ] && (rm -f $x; ln -s $mta/showfailures $x) x=/usr/bsd/hoststat; [ -f $x ] && (rm -f $x; ln -s $mta/showfailures $x) x=/usr/lib/hoststat; [ -f $x ] && (rm -f $x; ln -s $mta/showfailures $x) x=/usr/bin/purgestat; [ -f $x ] && (rm -f $x; ln -s $mta/clearfailures $x) x=/usr/sbin/purgestat; [ -f $x ] && (rm -f $x; ln -s $mta/clearfailures $x) x=/usr/ucb/purgestat; [ -f $x ] && (rm -f $x; ln -s $mta/clearfailures $x) x=/usr/bsd/purgestat; [ -f $x ] && (rm -f $x; ln -s $mta/clearfailures $x) x=/usr/lib/purgestat; [ -f $x ] && (rm -f $x; ln -s $mta/clearfailures $x)