procmail
[Top] [All Lists]

Re: Grepping body of message

2003-04-24 15:07:15
On Thu, Apr 24, 2003 at 11:18:52AM -0400, Ruben Safir wrote:

Right

Let me hit you with a clue stick...

The man page for procmail is imposssible to understand (hence the
examples page).

Furthermore, the egrep regex man page is equally impossible.

So a simple question of how to grep on the body, something I've tried
to do before without success, to the procmail list, which I've been a
member on for nearly 3 years, is appropriate.

But, Ruben, your timing with your question was just astonishing,
especially if you say you've been reading along (in lurker mode,
I take it) for three years.  I mean, I answered the fellow's
question about how to filter on the body; and within an hour,
you asked how.  You seem to be reading along here today.  Didn't
you read my answer?

-----Original Message-----
From: Dallman Ross [mailto:dman(_at_)nomotek(_dot_)com] 
Sent: Wednesday, April 23, 2003 8:57 PM
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Grepping body of message


On Wed, Apr 23, 2003 at 01:21:19PM -0500, Kim Scarborough wrote:

I'd like to trim down the messages I do get by grepping for foo|bar
in the body of the message and having only that display in the
body. The problem is that just piping it through grep will remove my
headers, too, which I obviously don't want. I thought maybe I could
use formail to grab the headers, then run the message through grep,
and re-prepend the captured headers to the truncated body, but that
seems difficult

No need to get that complicated.  Use the b flag with a filter:

 :0 bfw
 * your conditions
 | egrep -w '(foo|bar)'

-- dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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