On Fri, 13 Jun 1997, Rafael Reta wrote:
->How to filter an already existing mail with procmail?
->
->I been RTFM but found nothing. The only reference to ths is only the
->content of a FAQ that is not complete :(
Following my sig is an excerpt from the procmail man page. Read all the
man page stuff:)
jamie
jamie(_at_)comet(_dot_)net
***************************************************************************
For PGP public key, mail me with Subject:GET KEY
For random Ambrose Bierce quote, Mail me with Subject: ambrose
Support the anti-Spam amendment - Join at http://www.cauce.org/
"Microsoft was invented by domestic terrorists. Remember, it's
no longer an import industry."
------------------------------------------------------------------------------
Procmail can also be invoked to postprocess an already
filled system mailbox. This can be useful if you don't
want to or can't use a $HOME/.forward file (in which case
the following script could periodically be called from
within cron(1), or whenever you start reading mail):
#!/bin/sh
ORGMAIL=/var/mail/$LOGNAME
if cd $HOME &&
test -s $ORGMAIL &&
lockfile -r0 -l1024 .newmail.lock 2>/dev/null
then
trap "rm -f .newmail.lock" 1 2 3 13 15
umask 077
lockfile -l1024 -ml
cat $ORGMAIL >>.newmail &&
cat /dev/null >$ORGMAIL
lockfile -mu
formail -s procmail <.newmail &&
rm -f .newmail
rm -f .newmail.lock
fi
exit 0