[Gllug] Procmail

Richard Cohen richard at vmlinuz.org
Sat Jul 7 16:48:59 UTC 2001


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?):

              #!/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...

> Thanks
>
> Martin

Cheers
Richard


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list