procmail
[Top] [All Lists]

Re: using procmail on stdin

1998-02-19 13:06:52
Is there a way to use procmail or any other commands piped together
to context grep through a large mail file coming from stdin?  I
have some old mail files that are from before I was using procmail
to sort out my mail that are 25M or so that vi croaks on.  I have
used split to chop them up but it would be so much nicer if I could
just grep out the entire message based on "^From: blah(_at_)blah" or
"^Subject:  blah blah" that I wanted to keep and throw the rest
away.

Try using formail:

   cat mbox | formail -s procmail -m .procmailrc

will split each message on the ^From_ line, then pump that individual
message through your .procmailrc.  You can specify other filenames too:

   cat mbox | formail -s procmail -m procmailrc.special
   cat mbox | formail -s procmail -m procmailrc.joe-bob

Chris

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