<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML//EN">
<title>MHonArc Resources: MSGEXCFILTER
</title>
<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>
<!-- *************************************************************** -->
<dt><strong>Envariable
</strong></dt>
<code>M2H_MSGEXCFILTER=
</code><var>Perl_expressions
</var>
<dt><strong>Element
</strong></dt>
<code><MSGEXCFILTER
></code><br>
<var>Perl_expressions
</var><br>
<code></MSGEXCFILTER
></code><br>
<dt><strong>Command-line Option
</strong></dt>
<code>-msgexcfilter
</code><var>Perl_expressions
</var>
<!-- *************************************************************** -->
<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>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
<!-- *************************************************************** -->
<!-- *************************************************************** -->
<h2>Resource Variables
</h2>
<!-- *************************************************************** -->
<p>A typical usage of MSGEXCFILTER is to define a pattern match
<b><MsgExcFilter
></b>
<b></MsgExcFilter
></b>
<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>The following example attempts to exclude all messages not addressed
to
<tt>mhonarc-users@mhonarc.org
</tt>:
<b><MsgExcFilter
></b>
!/\bmhonarc-users@mhonarc.org\b/i;
<b></MsgExcFilter
></b>
<p>Here, we do what the
<a href=
"checknoarchive.html">CHECKNOARCHIVE
</a>
<b><MsgExcFilter
></b>
/^restrict:\s+no-external-archive/im ||
/^x-no-archive:\s+yes/im;
<b></MsgExcFilter
></b>
<!-- *************************************************************** -->
<!-- *************************************************************** -->
<a href=
"add.html">ADD
</a>,
<a href=
"checknoarchive.html">CHECKNOARCHIVE
</a>
<!-- *************************************************************** -->
<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>
$Date:
2002/
07/
27 05:
13:
10 $
<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@mhonarc.org"
>mhonarc@mhonarc.org
</a><br>