3 # Running my qcmd implementation on your system mailbox can quickly fill it up
4 # with PBS junk. This scans through the box and deletes any messages from the
8 # Procmail can also be invoked to postprocess an already filled system mailbox.
11 # This script is almost verbatim from 'man procmail'
13 ORIGMAILS="$MAIL $HOME/.mailspool/completed"
14 FILTER=$HOME/.mailspool/mailfilter/qcleanmail.proc
21 lockfile -r0 -l1024 .newmail.lock 2>/dev/null
24 trap "rm -f .newmail.lock" 1 2 3 13 15
25 echo "cleaning $ORIGMAIL"
26 # lock the system maildir, and extract all the messages
28 cat $ORIGMAIL >>.newmail &&
29 cat /dev/null >$ORIGMAIL
31 # lock released, now new messages can arrive as they normally do
33 # process the mail we copied out with our filter
34 # mail that should be in $ORIGMAIL will be appended as procmail notices...
35 formail -s procmail $FILTER <.newmail &&