procmail
[Top] [All Lists]

Re: procmail after sendmail

1997-12-05 21:46:34
Jim Burt asked,

| With mail already on my computer in one large file, how can I send it through 
| procmail?  I look for an occasional one-time solution.

There's a script for that toward the end of the procmail(1) man page.
Here's a cheap boil-down that will do pretty much the same thing:


    file=$1 #or plug it in by name

    lockfile $file.lock
    rawcount=`grep -c '^From ' $file`
    formail -$rawcount -s procmail < $file
    rm -f $file.lock

In case your .procmailrc has recipes that append a message to the file you're
working on, the -number option to formail makes formail stop where the input
file originally ended.

<Prev in Thread] Current Thread [Next in Thread>