procmail
[Top] [All Lists]

scanning for text within the first few lines of the body?

2002-03-29 15:10:24

I have some filters which I wrote which run _in_front_of_ several majordomo mailing lists.

I'd just as soon that they didn't need to spawn processes any more often than necessary, so I'm trying to figure out the lowest overhead way to restrict a search of the body text to just the first few lines.

Optimally, I'd like to be able to check whether a text is the first thing in the body. Specifically, I'm looking for _properly formatted_ majordomo approval commands (which are submitted to the list address, not the central majordomo address), which should bypass the filter set.

Any suggestions?

Currently, the condition is simply:

:0B
* ^Approved:[   ]+[^    ]+$
{
        do whatever
}

This doesn't consider whether the text is the first non-whitespace in tbe whole body, or limit the search to the first few lines.

I know I can accomplish this easily enough in perl, but I'd rather not fire up a perl process on each message if I can help it.
---
 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>