#!/bin/sh
#
# SendTo file...
#
# Scan the file(s) for To: lines, and mail the files to the recipient(s).
#
# This is a simple-minded approach that works, but is rather limited.
# See the Send command for a more powerful perl script.

mailcmd='smail -v'

for f
do	$mailcmd `grep '^To:' $f | sed \
		-e 's/^To:[ 	]//' \
		-e 's/,/\
/' \
		-e 's/\(.*\)(.*)/\1/' \
		-e 's/.*<\(.*\)>/\1/'` < $f
done
