#!/bin/csh
#mail-out	put mail into a spool file
#with locking.

#Change this to the program to run.
set PROG = "/home/myacct/Mix/mixmaster -R >> /home/myacct/Mix/log"

# Change this to the incoming mail spool directory.
cd /home/myacct/reorder

if (-e working) exit
if (-e none) exit
echo "" > working
echo "" > lock
sleep 10
mv in*  outgoing/
echo "" > none
\rm lock
foreach joe (outgoing/in*)
   cat $joe | $PROG
   \rm $joe
end
\rm working
