sm*: clean up sml, smq, and smr
[smtp.git] / smr
blob619943b60e638f5345eb3520da9678dc3a19dd64
1 #!/bin/sh
2 # Send queued messages
4 QDIR="$HOME/.smq"
6 cd "$QDIR" || exit 1
7 if ! test -f "`ls mail* 2>/dev/null | head -n1`"; then
8 echo "no mail in $QDIR"
9 exit 0
12 # process all mails
13 for m in mail*; do
14 if smtp <$m; then
15 rm "$m"
16 echo "$m sent successfully"
17 else
18 echo "failed to send $m"
20 done