Darren Spruell
2013-10-04 20:51:57 UTC
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
}
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
DS