examples/1rmail
raw| 1 | #!/bin/sh |
| 2 | # |
| 3 | # specify the mailbox file you want to read on the command line |
| 4 | # |
| 5 | MAILDIR=$HOME/Mail |
| 6 | cd $MAILDIR |
| 7 | LOCKFILE=$HOME/.lockmail |
| 8 | if lockfile -! -r1 $LOCKFILE |
| 9 | then |
| 10 | echo Mail is currently arriving, please wait... |
| 11 | while |
| 12 | lockfile -! -4 -r2 $LOCKFILE |
| 13 | do |
| 14 | echo Mail is still arriving... |
| 15 | done |
| 16 | fi |
| 17 | trap "rm -f $LOCKFILE;exit 0" 0 1 2 3 13 15 |
| 18 | # |
| 19 | # Call your favourite mailer here. |
| 20 | # |
| 21 | /usr/ucb/mail -f $* |