[Prev: MSGBODYEND] | [Next: MSGFOOT] |
M2H_MSGEXCFILTER=
Perl_expressions
<MSGEXCFILTER>
Perl_expressions
</MSGEXCFILTER>
-msgexcfilter
Perl_expressions
MSGEXCFILTER may be used to define Perl expressions to selectively exclude messages during an ADD operation. Unlike the CHECKNOARCHIVE resource, MSGEXCFILTER allows you to explicitly examine entire message headers to determine which messages should be added.
When defining the expressions, the raw message header will be in the $_ variable. If the last evaluated expression of MSGEXCFILTER returns a true value, or there is an explicit return statement that returns a true value, MHonArc will exclude the message.
Nil.
N/A
A typical usage of MSGEXCFILTER is to define a pattern match operation:
<MsgExcFilter> /^From: .*\behood@/im; </MsgExcFilter>
Here, we are excluding any messages that are from "ehood". The "m" modifier to the pattern match exists because the header will contain newlines.
The following example attempts to exclude all messages not addressed to mhonarc-users@mhonarc.org:
<MsgExcFilter> !/\bmhonarc-users@mhonarc.org\b/i; </MsgExcFilter>
Here, we do what the CHECKNOARCHIVE resource basically does:
<MsgExcFilter> /^restrict:\s+no-external-archive/im || /^x-no-archive:\s+yes/im; </MsgExcFilter>
2.4.1
[Prev: MSGBODYEND] | [Next: MSGFOOT] |