[Gllug] Procmail
Martin Stevens
budgester at budgester.com
Sat Jul 7 17:07:56 UTC 2001
On Sat, Jul 07, 2001 at 05:48:59PM +0100, Richard Cohen wrote:
> On Sat, 7 Jul 2001, Martin Stevens wrote:
>
> > Hi,
> >
> > I've finally got around to setting up procmail, but I have a stack of
> > mail in my mbox, can anyone tell me a recipie to retroactively run
> > procmail on my mbox to sort the mail according to the rules I've
> > set-up in procmail.
>
> >From the procmail man page (try reading before posting?):
I did, and found this as well, however it doesn't look like it will
do what I want it to, I use mutt and I have about 2000 mails that
have been moved to /home/budgester/mbox, therefore are no longer in the
system spool. As for shell scripting I'm still learning and the bit in the script below sending stuff to /dev/null scared the willy's out of me.
Back to ploughing through the reams of docs that is man procmail.
> #!/bin/sh
>
> ORGMAIL=/var/spool/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
>
> Adapt to your own circumstances...
I'm gonna try and understand what this script actually does before I run it.
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list