<html> <head> <title>MHonArc Resources: MSGEXCFILTER</title> <link rel="stylesheet" type="text/css" href="../docstyles.css"> </head> <body> <!--x-rc-nav--> <table border=0><tr valign="top"> <td align="left" width="50%">[Prev: <a href="msgbodyend.html">MSGBODYEND</a>]</td><td><nobr>[<a href="../resources.html#msgexcfilter">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="msgfoot.html">MSGFOOT</a>]</td></tr></table> <!--/x-rc-nav--> <hr> <h1>MSGEXCFILTER</h1> <!--X-TOC-Start--> <ul> <li><a href="#syntax">Syntax</a> <li><a href="#description">Description</a> <li><a href="#default">Default Setting</a> <li><a href="#rcvars">Resource Variables</a> <li><a href="#examples">Examples</a> <li><a href="#version">Version</a> <li><a href="#seealso">See Also</a> </ul> <!--X-TOC-End--> <!-- *************************************************************** --> <hr> <h2><a name="syntax">Syntax</a></h2> <dl> <dt><strong>Envariable</strong></dt> <dd><p> <code>M2H_MSGEXCFILTER=</code><var>Perl_expressions</var> </p> </dd> <dt><strong>Element</strong></dt> <dd><p> <code><MSGEXCFILTER></code><br> <var>Perl_expressions</var><br> <code></MSGEXCFILTER></code><br> </p> </dd> <dt><strong>Command-line Option</strong></dt> <dd><p> <code>-msgexcfilter </code><var>Perl_expressions</var> </p> </dd> </dl> <!-- *************************************************************** --> <hr> <h2><a name="description">Description</a></h2> <p>MSGEXCFILTER may be used to define Perl expressions to selectively exclude messages during an <a href="add.html">ADD</a> operation. Unlike the <a href="checknoarchive.html">CHECKNOARCHIVE</a> resource, MSGEXCFILTER allows you to explicitly examine entire message headers to determine which messages should be added. </p> <p>When defining the expressions, the raw message header will be in the <b><tt>$_</tt></b> variable. If the last evaluated expression of MSGEXCFILTER returns a true value, or there is an explicit <tt>return</tt> statement that returns a true value, MHonArc will exclude the message. </p> <!-- *************************************************************** --> <hr> <h2><a name="default">Default Setting</a></h2> <p>Nil. </p> <!-- *************************************************************** --> <hr> <h2><a name="rcvars">Resource Variables</a></h2> <p>N/A </p> <!-- *************************************************************** --> <hr> <h2><a name="examples">Examples</a></h2> <p>A typical usage of MSGEXCFILTER is to define a pattern match operation: </p> <pre> <b><MsgExcFilter></b> /^From: .*\behood<!-- -->@<!-- -->/im; <b></MsgExcFilter></b> </pre> <p>Here, we are excluding any messages that are from "ehood". The "<tt>m</tt>" modifier to the pattern match exists because the header will contain newlines. </p> <p>The following example attempts to exclude all messages not addressed to <tt>mhonarc-users<!-- -->@<!-- -->mhonarc.org</tt>: </p> <pre> <b><MsgExcFilter></b> !/\bmhonarc-users<!-- -->@<!-- -->mhonarc.org\b/i; <b></MsgExcFilter></b> </pre> <p>Here, we do what the <a href="checknoarchive.html">CHECKNOARCHIVE</a> resource basically does: </p> <pre> <b><MsgExcFilter></b> /^restrict:\s+no-external-archive/im || /^x-no-archive:\s+yes/im; <b></MsgExcFilter></b> </pre> <!-- *************************************************************** --> <hr> <h2><a name="version">Version</a></h2> <p>2.4.1 </p> <!-- *************************************************************** --> <hr> <h2><a name="seealso">See Also</a></h2> <p> <a href="add.html">ADD</a>, <a href="checknoarchive.html">CHECKNOARCHIVE</a> </p> <!-- *************************************************************** --> <hr> <!--x-rc-nav--> <table border=0><tr valign="top"> <td align="left" width="50%">[Prev: <a href="msgbodyend.html">MSGBODYEND</a>]</td><td><nobr>[<a href="../resources.html#msgexcfilter">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="msgfoot.html">MSGFOOT</a>]</td></tr></table> <!--/x-rc-nav--> <hr> <address> $Date: 2003/10/06 22:04:18 $ <br> <img align="top" src="../monicon.png" alt=""> <a href="http://www.mhonarc.org/" ><strong>MHonArc</strong></a><br> Copyright © 1999, <a href="http://www.earlhood.com/" >Earl Hood</a>, <a href="mailto:mhonarc%40mhonarc.org" >mhonarc<!-- -->@<!-- -->mhonarc.org</a><br> </address> </body> </html>