Ability to match against message body using lookup()

Darren Spruell <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Greetings,

I have a use case where I have short but growing list of patterns I'd
like to match against for filtering. I'd like the matches to be limited
to the Subject header and message body (but no other headers). I also
like the capability lookup() provides to stash patterns in a file (with
comments/etc.). I can see from the documentation that matching against a
concise expression (e.g. $MATCH1 from a header match) using lookup() is
easy, but how can you handle an expressions that matches against the
message body generally? Is it valid/correct to do something remotely
like this?

if ( /^Subject:\s*(.*)/ && lookup( $MATCH1, "interesting.dat" ) ||
     lookup( //:b, "interesting.dat" ) )
{
   # Do stuff
}

-- 
DS

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.