#!/bin/sh # domerge -- merge incoming mail and process. PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin export PATH die () { echo "$*" >& 2 exit 1 } # make sure we're in the right place... cd /other/outgoing/incoming || exit 0 # ...and we have something to do. anyfiles /other/outgoing/incoming || exit 0 # any crap forwarded from sys2/sys2? ib=$HOME/mail/inbox if test -s $ib then touch ./inbox && cat $ib >> ./inbox && cp /dev/null $ib fi # any gzipped files? ls 00*.gz > /dev/null 2>&1 && gunzip 00*.gz # if so, append to inbox touch inbox ls 00* > /dev/null 2>&1 && cat 00* >> inbox && rm 00* mb inbox # if inbox found, split it up if test -s inbox then spmail inbox && rm inbox for num in 0 1 2 3 4 5 6 7 8 9 do ( dir="data/inbox/$num"; test -d $dir && cd $dir && runmail ) done fi exit 0