On 2 Apr, Wade A. Mosely wrote:
| Don Hammond wrote:
| <excerpted>
| > At any rate, one way you might do this is something like:
| >
| > :0
| > * ^From(_dot_)123247N(_at_)knotes(_dot_)kodak(_dot_)com
| > * ^Subject:.*test
| > {
| > :0 Bc
| > *xxff
| > ! bird(_at_)cyber(_dot_)kodak(_dot_)com
| > :0 A:
| > in-testing
| > }
| >
| > [...]
|
| I am fairly new to using procmail. I am curious: Is the
| following recipe functionally equivalent? Is there any reason to
| not simplify it in this manner? (I am thinking that Don
| Hammond's solution is less resource intensive, since it only
| egreps the body if the previous conditions match. Am I correct?)
|
| :0
| * ^From(_dot_)123247N(_at_)knotes(_dot_)kodak(_dot_)com
| * ^Subject:.*test
| * B ?? xxff
| ! bird(_at_)cyber(_dot_)kodak(_dot_)com
|
| :0 A:
| in-testing
|
I think you're almost correct in your first assertion and incorrect in
the second, and all-in-all have a better solution. ;-)
The only reason you're only almost correct is you forgot a "c" flag on
the first part of the recipe, so it'll never get to the second. The
message will be forwarded and procmail will consider itself done. As
for the second assertion, mine is no more efficient. Since the
conditions are "anded" together, procmail doesn't bother with the body
search if your first two conditions don't match. So other than the
missing "c" flag, I believe the two are functionally identical and yours
gets the nod for simplicity.
--
/"\
Don Hammond \ / ASCII RIBBON CAMPAIGN
Raleigh, NC US X AGAINST HTML MAIL,
/ \ AND NEWS TOO
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail