mars-mail/ohpostme
2011-11-13 00:46:51 +01:00

19 lines
456 B
Bash
Executable File

#!/bin/bash
#This script runs through all the user dirs to collect mail that needs to be sent.
while [ true ] ;
do
cd /hamster/home
for l in `cat /etc/ohmaillist`
do
for x in `ls $l/pmail/out`
do
cat "$l/pmail/out/$x" | sed "1,4d" | /usr/sbin/sendmail -f "<$l@eng.rau.ac.za>" -t
rm "$l/pmail/out/$x"
echo "`date` -- Mail message $x send from $l mailbox" >> /var/log/ohpostme.log
done
sleep 1
done
sleep 5
done