procmail
[Top] [All Lists]

Re: Grepping body of message

2003-04-24 23:26:29
At 13:15 2003-04-24 -0700, multimedia-fan(_at_)myrealbox(_dot_)com did say:
>Huh? The above syntax will allow you to grep against a list of words and
>prhases.  Perhaps you want an _external_ list of words and phrases  - yes,
>to do that, you'd need an external script.  Either one which is run at
>runtime, or which is run against the wordlist whenever you change it, and
>that _creates_ a procmail recipe which you could INCLUDERC.
>

That's what I meant, which was obvious, and external list.

If you say so. I saw _no_ mention of external, and I fail to understand why you'd cite a procmail recipe doing exactly what you're _not_ trying to accomplish.

I would assume that the
expression_checked_against_the_body can use egrep and fgep on any
external program?
If so then you answered my question.

Simply running grep against the message body would be:

:0B
* ? grep -f sometextfile

If you want to check headers or body for some things, and pipe the body (in a condition), try:

:0B
* H ?? ^From: condition
* ? grep -i something

The B flag, and the use of "H (or B) ?? condition" is in 'man procmailrc' and 'man procmailex'. It's also been used countless times in recipes posted to this list.

All of which, I'm not ashamed to say, is pretty basic stuff. It certainly doesn't rank as procmail trickery.

Ehm, Sorry Sean, that wasn't me who commented on the Man pages, I never
even referred to them, I responded to a message from Ruben who said
that.

I posted one reply to the thread, rather than a bunch of separate messages in it, the "you" in my passage was whatever "you" happens to believe that the manpages are useless (as in "if you..."), which seems to be a common complaint of users new to procmail (and IME they generally also manage to demonstrate they're new to *nix as well).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
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>