procmail
[Top] [All Lists]

Re: Grepping body of message

2003-04-24 11:41:31
At 10:41 2003-04-24 -0700, multimedia-fan(_at_)myrealbox(_dot_)com wrote:

:0B:
* (phrase1|phrase2phrase1|phrase3|....)

A way to grep the body against a list of phrases, domains, words,
...etc, form the responses that I have seen is impossible with procmail
alone, unless you write a PERL script and feed the message to it.

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.

Also, instead of using the B flag, you can use the B _variable_, which contains the body text:

:0
* ^Some_header: expression
* B ?? expression_checked_against_the_body


I still disagree that the manpages are impossible to understand. If you feel so, then perhaps investing in a book such as _The_Procmail_Companion_ would be worthwhile.

The manpages may be a dry read, but that's manpages for you - function, not fluff.

Another possible solution for the users who don't read the manual or the available texts, would be to spend more time reading the messages which pass through this list even when they aren't in direct response to a query of their own, and check the archives, since such things have been spelled out countless times in the past.

And, run a sandbox -- being able to draft up a simple recipe and throw a test message at it to see what it does is an excellent way to learn. I'm constantly amazed that there are people putting _test_ recipies into their live procmailrc files and "waiting" for email to arrive to test it with. This is _NOT_ the appropriate method to test something.

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