Debian Codegraph @

examples/3rmail

raw
1 #!/bin/sh
2 #
3 # specify the mailbox file you want to read on the command line
4 # Use a relative path from your $HOME directory
5 #
6 # For this kind of chaotic procmailrc there is no uniform neat solution
7 # to determine which lockfiles to use. I'll give just one (suboptimal)
8 # solution here. Use your imagination to extend it :-).
9 #
10 MAILDIR=$HOME/Mail
11 cd $HOME # this means all paths are relative to $HOME
12 LOCKFILE=$HOME/.lockmail
13 LOCKFILE2=$HOME/Mail/whatever
14 if lockfile -! -r1 $LOCKFILE $LOCKFILE2
15 then
16 echo Mail is currently arriving, please wait...
17 while
18 lockfile -! -4 -r2 $LOCKFILE $LOCKFILE2
19 do
20 echo Mail is still arriving...
21 done
22 fi
23 trap "rm -f $LOCKFILE $LOCKFILE2;exit 0" 0 1 2 3 13 15
24 #
25 # Call your favourite mailer here.
26 #
27 /usr/ucb/mail -f $*