blob: 4fab6179aa6135aa53c548334a1b4c1a7e62596e [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Distributed James Server &mdash; Matchers :: Apache James</title>
<meta name="generator" content="Antora 3.1.2">
<link rel="stylesheet" href="../../../_/css/site.css">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://james.apache.org"><img src="/_/img/james.svg" alt="james logo"> Apache James</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="#">Home</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Products</a>
<div class="navbar-dropdown">
<div class="navbar-item"><strong>James server</strong></div>
<a class="navbar-item" href="https://github.com/apache/james-project">Repository</a>
<a class="navbar-item" href="https://issues.apache.org/jira/projects/JAMES/issues">Issue Tracker</a>
<hr class="navbar-divider">
<a class="navbar-item" href="https://james.apache.org/mime4j/index.html">Mime4J</a>
<a class="navbar-item" href="https://james.apache.org/jsieve/index.html">jSieve</a>
<a class="navbar-item" href="https://james.apache.org/jspf/index.html">jSPF</a>
<a class="navbar-item" href="https://james.apache.org/jdkim/index.html">jDKIM</a>
<a class="navbar-item" href="https://james.apache.org/hupa/index.html">HUPA</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Community</a>
<div class="navbar-dropdown">
<!-- Not ideal but dropping the version in the href requires tweaking james-projet docs module first -->
<a class="navbar-item" href="/james-project/3.6.0/community/mailing-lists.html">Mailing lists</a>
<a class="navbar-item" href="https://gitter.im/apache/james-project"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="logo-gitter-sign" data-v-44ebcb1a=""><rect x="15" y="5" width="2" height="10"></rect> <rect x="10" y="5" width="2" height="20"></rect> <rect x="5" y="5" width="2" height="20"></rect> <rect width="2" height="15"></rect></svg> Gitter</a>
<a class="navbar-item" href="https://twitter.com/ApacheJames">
<span class="icon">
<svg aria-hidden="true" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="#57aaee" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
</svg>
</span> Twitter
</a>
<a class="navbar-item" href="#"> <svg class="octicon octicon-mark-github v-align-middle" viewBox="0 0 16 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Github</a>
</div>
</div>
<!-- <div class="navbar-item">
<span class="control">
<a class="button is-primary" href="#">Download</a>
</span>
</div> -->
</div>
</div>
</nav>
</header>
<div class="body">
<div class="nav-container" data-component="james-distributed-app" data-version="3.8.1">
<aside class="nav">
<div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<button class="nav-menu-toggle" aria-label="Toggle expand/collapse all" style="display: none"></button>
<h3 class="title"><a href="../index.html">Apache James Distributed Server</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../index.html">Distributed James Application</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../objectives.html">Objectives and motivation</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../architecture/index.html">Architecture</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../architecture/implemented-standards.html">Implemented standards</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../architecture/consistency-model.html">Consistency Model</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../architecture/specialized-instances.html">Specialized instances</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../run/index.html">Run</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../run/run-java.html">Run with Java</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../run/run-docker.html">Run with Docker</a>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../run/run-kubernetes.html">Run with Kubernetes</a>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../run/k8s-checklist.html">Deployment Checklist</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../run/k8s-logsMetrics.html">Logs &amp; Metrics</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../run/k8s-values.html">values.yaml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../run/k8s-secrets.html">secrets.yaml</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="index.html">Configuration</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Protocols</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="imap.html">imapserver.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="jmap.html">jmap.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="jmx.html">jmx.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="smtp.html">smtpserver.xml &amp; lmtpserver.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="smtp-hooks.html">Packaged SMTP hooks</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="pop3.html">pop3server.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="webadmin.html">webadmin.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="ssl.html">SSL &amp; TLS</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="sieve.html">Sieve &amp; ManageSieve</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Storage dependencies</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="blobstore.html">blobstore.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="cassandra.html">cassandra.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="opensearch.html">opensearch.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="rabbitmq.html">rabbitmq.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="redis.html">redis.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="tika.html">tika.properties</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Core components</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="batchsizes.html">batchsizes.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="dns.html">dnsservice.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="domainlist.html">domainlist.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="healthcheck.html">healthcheck.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="mailetcontainer.html">mailetcontainer.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="mailets.html">Packaged Mailets</a>
</li>
<li class="nav-item is-current-page" data-depth="4">
<a class="nav-link" href="matchers.html">Packaged Matchers</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="mailrepositorystore.html">mailrepositorystore.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="recipientrewritetable.html">recipientrewritetable.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="search.html">search.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="usersrepository.html">usersrepository.xml</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Extensions</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="vault.html">deletedMessageVault.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="extensions.html">extensions.properties</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="listeners.html">listeners.xml</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="spam.html">Anti-Spam setup</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="remote-delivery-error-handling.html">About RemoteDelivery error handling</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="collecting-contacts.html">Contact collection</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="collecting-events.html">Event collection</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="dsn.html">ESMTP DSN support</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../operate/index.html">Operate</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/guide.html">Operator guide</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/performanceChecklist.html">Performance checklist</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/logging.html">Logging</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/webadmin.html">WebAdmin REST administration API</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/metrics.html">Metrics</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/migrating.html">Migrating existing data</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/cli.html">Command Line Interface</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/cassandra-migration.html">Cassandra migration</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../operate/security.html">Security checklist</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../extending/index.html">Extending server behavior</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../extending/mail-processing.html">Custom mail processing components</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../extending/mailbox-listeners.html">Custom Mailbox Listeners</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../extending/smtp-hooks.html">Custom SMTP hooks</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../extending/webadmin-routes.html">Custom WebAdmin routes</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../extending/imap.html">Custom IMAP processing</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../benchmark/index.html">Performance benchmark</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../benchmark/db-benchmark.html">Database benchmarks</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../benchmark/james-benchmark.html">James benchmarks</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Apache James Distributed Server</span>
<span class="version">3.8.1 SNAPSHOT</span>
</div>
<ul class="components">
<li class="component is-current">
<div class="title"><a href="../index.html">Apache James Distributed Server</a></div>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../index.html">3.8.1 SNAPSHOT</a>
</li>
</ul>
</li>
<li class="component">
<div class="title"><a href="../../../james-project/3.8.1/index.html">Apache James Server</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="../../../james-project/3.8.1/index.html">3.8.1 SNAPSHOT</a>
</li>
<li class="version">
<a href="../../../james-project/3.6.0/index.html">3.6.0 Snapshot</a>
</li>
</ul>
</li>
<li class="component">
<div class="title"><a href="../../../james-site/latest/index.html">Apache James Site</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="../../../james-site/latest/index.html">latest</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../../james-site/latest/homepage.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../index.html">Apache James Distributed Server</a></li>
<li><a href="../index.html">Distributed James Application</a></li>
<li><a href="index.html">Configuration</a></li>
<li>Core components</li>
<li><a href="matchers.html">Packaged Matchers</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/apache/james-project/blob/master/server/apps/distributed-app/docs/modules/ROOT/pages/configure/matchers.adoc">Edit this Page</a></div>
</div>
<div class="content">
<aside class="toc sidebar" data-title="Contents" data-levels="2">
<div class="toc-menu"></div>
</aside>
<article class="doc">
<h1 class="page">Distributed James Server &mdash; Matchers</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This documentation page lists and documents Matchers that can be used within the
Distributed Server MailetContainer in order to write your own mail processing logic with out-of-the-box components.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_supported_matchers"><a class="anchor" href="#_supported_matchers"></a>Supported matchers</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_all"><a class="anchor" href="#_all"></a>All</h3>
<div class="paragraph">
<p>Matches all mail.</p>
</div>
</div>
<div class="sect2">
<h3 id="_atleastpriority"><a class="anchor" href="#_atleastpriority"></a>AtLeastPriority</h3>
<div class="paragraph">
<p>Numeric value. The priority of this mail should be at least the specified value to be matched.</p>
</div>
<div class="paragraph">
<p>Inclusive.</p>
</div>
</div>
<div class="sect2">
<h3 id="_atmost"><a class="anchor" href="#_atmost"></a>AtMost</h3>
<div class="paragraph">
<p>Checks that a mail did at most X executions on a specific operation.</p>
</div>
<div class="literalblock">
<div class="content">
<pre> If no executions have been performed previously for Y attribute, it will be set up.
In the mail, every time the check succeeds, its counter will be incremented by one.
The check fails when the defined X limit is reached.</pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>X - count of how many times a specific operation is performed</p>
</li>
<li>
<p>Y - name of attribute represented for specific operation executions, default value is: <strong>AT_MOST_EXECUTIONS</strong></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The example below will match a mail with at most 3 executions on the mailet
with attribute name <strong>AT_MOST_EXECUTIONS</strong></p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="AtMost=AT_MOST_EXECUTIONS:3" class="&lt;any-class&gt;"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_atmostpriority"><a class="anchor" href="#_atmostpriority"></a>AtMostPriority</h3>
<div class="paragraph">
<p>Numeric value. The priority of this mail should be at most the specified value to be matched.</p>
</div>
<div class="paragraph">
<p>Inclusive.</p>
</div>
</div>
<div class="sect2">
<h3 id="_dlp"><a class="anchor" href="#_dlp"></a>DLP</h3>
<div class="paragraph">
<p>Enable evaluation of incoming emails against DLP rules (Data Leak Prevention) attached to the sender domains.</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>&lt;mailet match="DLP" class="ToRepository"&gt;
&lt;repositoryPath&gt;/var/mail/quarantine&lt;/repositoryPath&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Rules can be administered via <a href="../operate/webadmin.html#_administrating_dlp_configuration" class="xref page">webAdmin</a>.</p>
</div>
<div class="paragraph">
<p>Only available on top of Memory and Cassandra storages.</p>
</div>
<div class="paragraph">
<p>Additionally a cache can be added to reduce queries done to the underlying database.</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>&lt;mailet match="DLP=cache:60s" class="ToRepository"&gt;
&lt;repositoryPath&gt;/var/mail/quarantine&lt;/repositoryPath&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Will query the DLP rules for a given domain only every 60 seconds.</p>
</div>
<div class="paragraph">
<p>Please note that querying DLP rules on top of Cassandra relies on Event sourcing, involves reading a potentially
large event stream and involves some SERIAL reads (LightWeight transactions) for each processed emails.</p>
</div>
<div class="paragraph">
<p>Efficiency of the cache can be tracked with the following metrics:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>dlp.cache.hitRate</code></p>
</li>
<li>
<p><code>dlp.cache.missCount</code></p>
</li>
<li>
<p><code>dlp.cache.hitCount</code></p>
</li>
<li>
<p><code>dlp.cache.size</code></p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_fetchedfrom"><a class="anchor" href="#_fetchedfrom"></a>FetchedFrom</h3>
<div class="paragraph">
<p>Matches mail with a header set by Fetchpop X-fetched-from</p>
</div>
<div class="paragraph">
<p>fetchpop sets X-fetched-by to the "name" of the fetchpop fetch task.</p>
</div>
<div class="paragraph">
<p>This is used to match all mail fetched from a specific pop account.</p>
</div>
<div class="paragraph">
<p>Once the condition is met the header is stripped from the message to prevent looping if
the mail is re-inserted into the spool.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hasattachment"><a class="anchor" href="#_hasattachment"></a>HasAttachment</h3>
<div class="paragraph">
<p>Checks whether this message has an attachment</p>
</div>
</div>
<div class="sect2">
<h3 id="_hasexception"><a class="anchor" href="#_hasexception"></a>HasException</h3>
<div class="paragraph">
<p>This Matcher determines if the exception specified in the condition or
the subclasses of it has occurred during the processing of the mail.
If true, all recipients are returned, else null. This matcher presupposes
that the exception has been captured as a Mail attribute
org.apache.mailet.Mail#MAILET_ERROR_ATTRIBUTE_NAME in the process.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasException=org.apache.james.managesieve.api.ManageSieveException" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_hasheader"><a class="anchor" href="#_hasheader"></a>HasHeader</h3>
<div class="paragraph">
<p>use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasHeader={&lt;header&gt;[=value]}+" class="..." /&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>This matcher checks if the header is present in the message (global) and per recipient (specific). It complements the AddHeader mailet.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hasheaderwithprefix"><a class="anchor" href="#_hasheaderwithprefix"></a>HasHeaderWithPrefix</h3>
<div class="paragraph">
<p>Matches emails with headers having a given prefix.</p>
</div>
<div class="paragraph">
<p>If a header with the given prefix is found in the message (global) all recipients will be matched.
If a header with the given prefix is found per recipient (specific), only these will be matched.</p>
</div>
<div class="paragraph">
<p>Otherwise, no recipient in returned.</p>
</div>
<div class="paragraph">
<p>use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasHeaderWithPrefix=PREFIX" class="..." /&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_hasmailattribute"><a class="anchor" href="#_hasmailattribute"></a>HasMailAttribute</h3>
<div class="paragraph">
<p>This Matcher determines if the mail contains the attribute specified in the
condition, and returns all recipients if it is the case.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasMailAttribute=whatever" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_hasmailattributewithvalue"><a class="anchor" href="#_hasmailattributewithvalue"></a>HasMailAttributeWithValue</h3>
<div class="paragraph">
<p>This Matcher determines if the mail contains the attribute specified in
the condition and if the value answered when the method toString() is
invoked on the attribute is equal to the String value specified in the
condition. If both tests are true, all recipients are returned, else null.</p>
</div>
<div class="paragraph">
<p>Notes:</p>
</div>
<div class="paragraph">
<p>The current matcher implementation expects a single String value to match
on. This matcher requires two values, the attribute name and attribute
value. This requires some implicit rules to govern how the single value
supplied to the matcher is parsed into two values.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>In the match condition, the split between the attribute name and the
attribute value is made at the first comma. Attribute names that include
a comma will parse incorrectly and therefore are not supported by this
matcher.</p>
</li>
<li>
<p>Leading and trailing spaces are removed from both the attribute name and
attribute value specified in the condition and the tested attribute value in
the mail prior to matching. Therefore, "abc" , " abc", "abc " and " abc "
are considered equivalent.</p>
</li>
<li>
<p>To test for an empty string, do not specify an attribute value after the
comma.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasMailAttributeWithValue=name, value" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_hasmailattributewithvalueregex"><a class="anchor" href="#_hasmailattributewithvalueregex"></a>HasMailAttributeWithValueRegex</h3>
<div class="paragraph">
<p>This Matcher determines if the mail contains the attribute specified in the
condition and that attribute matches the supplied regular expression,
it returns all recipients if that is the case.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasMailAttributeWithValueRegex=whatever,&lt;regex&gt;" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Note: as it is not possible to put arbitrary objects in the configuration,
toString() is called on the attribute value, and that is the value matched against.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hasmimetype"><a class="anchor" href="#_hasmimetype"></a>HasMimeType</h3>
<div class="paragraph">
<p>This matcher checks if the content type matches.</p>
</div>
<div class="paragraph">
<p>This matcher does not walk down the mime tree and stops at the top level mime part.</p>
</div>
<div class="paragraph">
<p>use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasMimeType=text/plain,text/html" class="..." /&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_hasmimetypeparameter"><a class="anchor" href="#_hasmimetypeparameter"></a>HasMimeTypeParameter</h3>
<div class="paragraph">
<p>This matcher checks if the content type parameters matches.</p>
</div>
<div class="paragraph">
<p>use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasMimeTypeParameter=report-type=disposition-notification,report-type=other" class="..." /&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_haspriority"><a class="anchor" href="#_haspriority"></a>HasPriority</h3>
<div class="paragraph">
<p>Numeric value. The priority of this mail should be equal to the specified value to be matched.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hostis"><a class="anchor" href="#_hostis"></a>HostIs</h3>
<div class="paragraph">
<p>Matches mail to given hosts.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hostislocal"><a class="anchor" href="#_hostislocal"></a>HostIsLocal</h3>
<div class="paragraph">
<p>Matches mail to Domains which are local</p>
</div>
</div>
<div class="sect2">
<h3 id="_ismarkedasspam"><a class="anchor" href="#_ismarkedasspam"></a>IsMarkedAsSpam</h3>
<div class="paragraph">
<p>Matches mails having a <strong>org.apache.james.spamassassin.status</strong> per recipient header with a <strong>Yes</strong> value.</p>
</div>
<div class="paragraph">
<p>As an example, here is a part of a mailet pipeline which can be used in your LocalDelivery processor:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;!-- SpamAssassing mailets pipeline --&gt;
&lt;mailet match="RecipientIsLocal" class="SpamAssassin"&gt;
&lt;spamdHost&gt;spamassassin&lt;/spamdHost&gt;
&lt;spamdPort&gt;783&lt;/spamdPort&gt;
&lt;/mailet&gt;
&lt;mailet match="IsMarkedAsSpam" class="WithStorageDirective"&gt;
&lt;targetFolderName&gt;Spam&lt;/targetFolderName&gt;
&lt;/mailet&gt;
&lt;!-- End of SpamAssassing mailets pipeline --&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>In order to use this with <code>rspamd</code>, we need to declare a condition for the matcher
and drop the Rspamd jar (<strong>third-party/rspamd</strong>) in the James extensions-jars folder.
Eg: With the recipient header for Rspamd being <strong>org.apache.james.rspamd.status</strong>,
then the configuration would be:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;!-- Rspamd mailets pipeline --&gt;
&lt;mailet match="IsMarkedAsSpam=org.apache.james.rspamd.status" class="WithStorageDirective"&gt;
&lt;targetFolderName&gt;Spam&lt;/targetFolderName&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_isoverquota"><a class="anchor" href="#_isoverquota"></a>IsOverQuota</h3>
<div class="paragraph">
<p>This matcher will check if the incoming email will make recipients exceed their quotas.</p>
</div>
<div class="paragraph">
<p>Here is a configuration example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="IsOverQuota" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_isremotedeliverypermanenterror"><a class="anchor" href="#_isremotedeliverypermanenterror"></a>IsRemoteDeliveryPermanentError</h3>
<div class="paragraph">
<p>Checks if the mail has a permanent remote delivery failure attribute</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="IsRemoteDeliveryPermanentError" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_isremotedeliverypermanenterror_2"><a class="anchor" href="#_isremotedeliverypermanenterror_2"></a>IsRemoteDeliveryPermanentError</h3>
<div class="paragraph">
<p>Checks if the mail has a temporary remote delivery failure attribute set to false (meaning it&#8217;s a temporary error)</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="IsRemoteDeliveryTemporaryError" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_issenderinrrtloop"><a class="anchor" href="#_issenderinrrtloop"></a>IsSenderInRRTLoop</h3>
<div class="paragraph">
<p>This matcher allow you to know if the sender of an email is part of a RRT loop.</p>
</div>
<div class="paragraph">
<p>This is useful when bouncing upon RRT execution issues: we don&#8217;t want to create a bouncing loop
(as the execution of that RRT loop will fail).</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="IsSenderInRRTLoop" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_issinglerecipient"><a class="anchor" href="#_issinglerecipient"></a>IsSingleRecipient</h3>
<div class="paragraph">
<p>Matches mail where the number of recipients is exactly one.</p>
</div>
</div>
<div class="sect2">
<h3 id="_issmimeencrypted"><a class="anchor" href="#_issmimeencrypted"></a>IsSMIMEEncrypted</h3>
<div class="paragraph">
<p>Checks if a mail is smime encrypted.</p>
</div>
</div>
<div class="sect2">
<h3 id="_issmimesigned"><a class="anchor" href="#_issmimesigned"></a>IsSMIMESigned</h3>
<div class="paragraph">
<p>Checks if a mail is smime encrypted.</p>
</div>
</div>
<div class="sect2">
<h3 id="_isx509certificatesubject"><a class="anchor" href="#_isx509certificatesubject"></a>IsX509CertificateSubject</h3>
<div class="paragraph">
<p>Checks if the subject of a X509Certificate contains the supplied string. The
certificate is read from the specified mail attribute.</p>
</div>
<div class="paragraph">
<p>If the specified attribute contains more than one certificate the matcher matches if at
least one of the certificates contains the given string.</p>
</div>
<div class="paragraph">
<p>Configuration string:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>mailAttribute;string</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_recipientdomainis"><a class="anchor" href="#_recipientdomainis"></a>RecipientDomainIs</h3>
<div class="paragraph">
<p>This will return recipients matching a configured domain.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientDomainIs=&lt;domain.com&gt;" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_recipientis"><a class="anchor" href="#_recipientis"></a>RecipientIs</h3>
<div class="paragraph">
<p>This matcher matches a specific recipient (in the envelope of the mail), passed as a condition to
this matcher.</p>
</div>
<div class="paragraph">
<p>The example below will match only the recipient user@domain</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=&amp;quot;RecipientIs=user@domain&amp;quot; class=&amp;quot;&lt;any-class&gt;&amp;quot;&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_recipientislocal"><a class="anchor" href="#_recipientislocal"></a>RecipientIsLocal</h3>
<div class="paragraph">
<p>Matches mail where the recipient is local.</p>
</div>
</div>
<div class="sect2">
<h3 id="_recipientisregex"><a class="anchor" href="#_recipientisregex"></a>RecipientIsRegex</h3>
<div class="paragraph">
<p>Matches recipients whose address matches a regular expression.</p>
</div>
<div class="paragraph">
<p>Is equivalent to the SenderIsRegex matcher but matching on the recipient.</p>
</div>
<div class="paragraph">
<p>Configuration string: a regular expression.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIsRegex=&lt;regular-expression&gt;" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The example below will match any recipient in the format user@log.anything</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIsRegex=(.*)@log\.(.*)" class="&lt;any-class&gt;"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_relaylimit"><a class="anchor" href="#_relaylimit"></a>RelayLimit</h3>
<div class="paragraph">
<p>Matches mail which has been relayed more than a given number of times.</p>
</div>
</div>
<div class="sect2">
<h3 id="_remoteaddrinnetwork"><a class="anchor" href="#_remoteaddrinnetwork"></a>RemoteAddrInNetwork</h3>
<div class="paragraph">
<p>Checks the IP address of the sending server against a comma-delimited list
of IP addresses, domain names or sub-nets.</p>
</div>
<div class="paragraph">
<p>See AbstractNetworkMatcher for details on how to specify entries.</p>
</div>
</div>
<div class="sect2">
<h3 id="_remoteaddrinnetwork_2"><a class="anchor" href="#_remoteaddrinnetwork_2"></a>RemoteAddrInNetwork</h3>
<div class="paragraph">
<p>Checks the IP address of the sending server against a comma-delimited list
of IP addresses, domain names or sub-nets.</p>
</div>
<div class="paragraph">
<p>See AbstractNetworkMatcher for details on how to specify entries.</p>
</div>
</div>
<div class="sect2">
<h3 id="_remotedeliveryfailedwithsmtpcode"><a class="anchor" href="#_remotedeliveryfailedwithsmtpcode"></a>RemoteDeliveryFailedWithSMTPCode</h3>
<div class="paragraph">
<p>Checks the SMTP error code attached to remote delivery failures</p>
</div>
</div>
<div class="sect2">
<h3 id="_senderdomainis"><a class="anchor" href="#_senderdomainis"></a>SenderDomainIs</h3>
<div class="paragraph">
<p>SenderDomainIs will look at the envelope sender&#8217;s domain. If equal to
configured value, then all recipients will be returned. Otherwise an empty
list will be returned.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderDomainIs=&lt;domain.com&gt;" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_senderhostis"><a class="anchor" href="#_senderhostis"></a>SenderHostIs</h3>
<div class="paragraph">
<p>Checks the sender&#8217;s displayed domain name against a supplied list.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderHostIs=domain.com" class="ToProcessor"&gt;
&lt;processor&gt; spam &lt;/processor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_senderis"><a class="anchor" href="#_senderis"></a>SenderIs</h3>
<div class="paragraph">
<p>This matcher matches a specific sender, passed as a condition to this matcher.</p>
</div>
<div class="paragraph">
<p>The example below will match mail with a sender being user@domain</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderIs=user@domain" class="&lt;any-class&gt;"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_senderislocal"><a class="anchor" href="#_senderislocal"></a>SenderIsLocal</h3>
<div class="paragraph">
<p>Matches mail where the sender is local.</p>
</div>
</div>
<div class="sect2">
<h3 id="_senderisnull"><a class="anchor" href="#_senderisnull"></a>SenderIsNull</h3>
<div class="paragraph">
<p>Matches mails that are sent by a null sender.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderIsNull" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_senderisregex"><a class="anchor" href="#_senderisregex"></a>SenderIsRegex</h3>
<div class="paragraph">
<p>Matches mails that are sent by a sender whose address matches a regular expression.</p>
</div>
<div class="paragraph">
<p>Is equivalent to the RecipientIsRegex matcher but matching on the sender.</p>
</div>
<div class="paragraph">
<p>Configuration string: a regular expression.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderIsRegex=&lt;regular-expression&gt;" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The example below will match any sender in the format user@log.anything</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderIsRegex=(.*)@log\.(.*)" class="&lt;any-class&gt;"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Another example below will match any sender having some variations of the string
<strong>mp3</strong> inside the username part.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SenderIsRegex=(.*)(mp3|emmepitre)(.*)@" class="&lt;any-class&gt;"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_sentbyjmap"><a class="anchor" href="#_sentbyjmap"></a>SentByJmap</h3>
<div class="paragraph">
<p>Matches mails sent via the JMAP protocol.</p>
</div>
</div>
<div class="sect2">
<h3 id="_sentbymailet"><a class="anchor" href="#_sentbymailet"></a>SentByMailet</h3>
<div class="paragraph">
<p>This matcher matches email sent automatically by mailets.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SentByMailetAny" class="&lt;any-class&gt;"/&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>This matcher allows you, for instance, to enable/disable routing automatically generated emails out of your server.</p>
</div>
</div>
<div class="sect2">
<h3 id="_sizegreaterthan"><a class="anchor" href="#_sizegreaterthan"></a>SizeGreaterThan</h3>
<div class="paragraph">
<p>Checks whether the message (entire message, not just content) is greater
than a certain number of bytes. You can use 'k' and 'm' as optional postfixes.</p>
</div>
<div class="paragraph">
<p>In other words, "1m" is the same as writing "1024k", which is the same as
"1048576".</p>
</div>
</div>
<div class="sect2">
<h3 id="_smtpauthsuccessful"><a class="anchor" href="#_smtpauthsuccessful"></a>SMTPAuthSuccessful</h3>
<div class="paragraph">
<p>Matches mails that are sent by an SMTP authenticated user.</p>
</div>
<div class="paragraph">
<p>If the sender was not authenticated it will not match.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SMTPAuthSuccessful" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_smtpauthuseris"><a class="anchor" href="#_smtpauthuseris"></a>SMTPAuthUserIs</h3>
<div class="paragraph">
<p>Matches mails that are sent by an SMTP authenticated user present in a supplied list.</p>
</div>
<div class="paragraph">
<p>If the sender was not authenticated it will not match.</p>
</div>
<div class="paragraph">
<p>Configuration string: a comma, tab or space separated list of James users.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SMTPAuthUserIs=&lt;list-of-user-names&gt;" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_smtpisauthnetwork"><a class="anchor" href="#_smtpisauthnetwork"></a>SMTPIsAuthNetwork</h3>
<div class="paragraph">
<p>Matches mails that are sent by a client which is allowed to relay.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="SMTPIsAuthNetwork" class="&lt;any-class&gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_subjectis"><a class="anchor" href="#_subjectis"></a>SubjectIs</h3>
<div class="paragraph">
<p>Matches mail where the subject is contained in a configurable list.</p>
</div>
</div>
<div class="sect2">
<h3 id="_subjectis_2"><a class="anchor" href="#_subjectis_2"></a>SubjectIs</h3>
<div class="paragraph">
<p>Matches mail where the subject starts with a given phrase.</p>
</div>
</div>
<div class="sect2">
<h3 id="_toomanyrecipients"><a class="anchor" href="#_toomanyrecipients"></a>TooManyRecipients</h3>
<div class="paragraph">
<p>This matcher matches emails that have too many recipients.</p>
</div>
<div class="paragraph">
<p>The example below will reject any email with more than 5 recipients</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="TooManyRecipients=5" class="&lt;any-class&amp;gt;"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_useris"><a class="anchor" href="#_useris"></a>UserIs</h3>
<div class="paragraph">
<p>Matches mail where the user is contained in a configurable list.</p>
</div>
</div>
<div class="sect2">
<h3 id="_xoriginatingipinnetwork"><a class="anchor" href="#_xoriginatingipinnetwork"></a>XOriginatingIpInNetwork</h3>
<div class="paragraph">
<p>Checks the first X_ORIGINATING_IP IP address against a comma-delimited list
of IP addresses, domain names or sub-nets.</p>
</div>
<div class="paragraph">
<p>See AbstractNetworkMatcher for details on how to specify entries.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_experimental_matchers"><a class="anchor" href="#_experimental_matchers"></a>Experimental matchers</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_attachmentfilenameis"><a class="anchor" href="#_attachmentfilenameis"></a>AttachmentFileNameIs</h3>
<div class="paragraph">
<p>Checks if at least one attachment has a file name which matches any
element of a comma-separated or space-separated list of file name masks.</p>
</div>
<div class="paragraph">
<p>Syntax: <strong>match="AttachmentFileNameIs=[-d] [-z] masks"</strong></p>
</div>
<div class="paragraph">
<p>The match is case insensitive.</p>
</div>
<div class="paragraph">
<p>File name masks may start with a wildcard '\*'.</p>
</div>
<div class="paragraph">
<p>Multiple file name masks can be specified, e.g.: '*.scr,\*.bat'.</p>
</div>
<div class="paragraph">
<p>If '<strong>-d</strong>' is coded, some debug info will be logged.</p>
</div>
<div class="paragraph">
<p>If '<strong>-z</strong>' is coded, the check will be non-recursively applied
to the contents of any attached '*.zip' file.</p>
</div>
</div>
<div class="sect2">
<h3 id="_commandforlistserv"><a class="anchor" href="#_commandforlistserv"></a>CommandForListserv</h3>
<div class="paragraph">
<p>Returns positive if the recipient is a command for a listserv. For example,
if my listserv is <a href="mailto:james@list.working-dogs.com">james@list.working-dogs.com</a>, this matcher will return true
for <a href="mailto:james-on@list.working-dogs.com">james-on@list.working-dogs.com</a> and <a href="mailto:james-off@list.working-dogs.com">james-off@list.working-dogs.com</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="_commandlistservmatcher"><a class="anchor" href="#_commandlistservmatcher"></a>CommandListservMatcher</h3>
<div class="paragraph">
<p>CommandListservMatcher is the matcher that pairs with the CommandListservManager
It checks to see if the request is intended for the ListservManager, but doesn&#8217;t guarantee that it is a valid command.</p>
</div>
<div class="paragraph">
<p>To configure, insert this into the config.xml inside of the root processor block.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="CommandListservMatcher=announce@localhost" class="CommandListservManager"&gt;
...
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_comparenumericheadervalue"><a class="anchor" href="#_comparenumericheadervalue"></a>CompareNumericHeaderValue</h3>
<div class="paragraph">
<p>Matches mails containing a header with a numeric value whose comparison with the specified value is true.</p>
</div>
<div class="paragraph">
<p>If the header is missing in the message, there will be <strong>no match</strong></p>
</div>
<div class="paragraph">
<p>Configuration string: The headerName, a comparison operator and the numeric headerValue
to compare with, <strong>space or tab delimited</strong>.</p>
</div>
<div class="paragraph">
<p>The comparison operators are: <strong>&lt;, &#8656;, ==, &gt;=, &gt;</strong>;
another set of operators is: <strong>LT, LE, EQ, GE, GT</strong>.</p>
</div>
<div class="paragraph">
<p>Also the following operators are accepted: <strong>=&lt;, =, &#8658;</strong>.</p>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability &gt; 0.9" class="ToProcessor"&gt;
&lt;processor&gt; spam &lt;/processor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_fileregexmatcher"><a class="anchor" href="#_fileregexmatcher"></a>FileRegexMatcher</h3>
<div class="paragraph">
<p>Initializes RegexMatcher with regular expressions from a file.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hashabeaswarrantmark"><a class="anchor" href="#_hashabeaswarrantmark"></a>HasHabeasWarrantMark</h3>
<div class="paragraph">
<p>This matcher tests for the Hebeas Warrant Mark.
For details see: <a href="http://www.hebeas.com" class="bare">http://www.hebeas.com</a></p>
</div>
<div class="paragraph">
<p>Usage: Place this matcher</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="HasHabeasWarrantMark" class="ToProcessor"&gt;
&lt;processor&gt; transport &lt;/processor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>in the root processes before the DNSRBL block lists (the InSpammerBlacklist matcher).</p>
</div>
<div class="paragraph">
<p>Because the Habeas Warrant Mark is copyright material, I have asked for and
received the following explicit statement from Habeas:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>-----------------------------------
From: Lindsey Pettit [mailto:support@habeas.com]
Sent: Sunday, September 29, 2002 5:51
To: Noel J. Bergman
Subject: RE: Habeas and Apache James
Dear Noel,
&gt; I guess that since your Warrant Mark is copyright, I should ask for
&gt; something from you to explicitly authorize that Hebeas will permit
&gt; this code to be included and distributed as part of Apache James
&gt; under the Apache Software License. As we have established, the use
&gt; of the Habeas Warrant Mark for filtering is not restricted, but I
&gt; would like something to confirm that, so that Apache will be happy.
I can hereby confirm to you that there is no license necessary in
order to use the Habeas mark for filtering. That said, however, we
do insist that it not ever be used as a basis for rejecting email which
bears the Habeas mark.
-----------------------------------</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_inspammerblacklist"><a class="anchor" href="#_inspammerblacklist"></a>InSpammerBlacklist</h3>
<div class="paragraph">
<p>Checks the network IP address of the sending server against a blacklist of
spammers. There are 3 lists that support this&#8230;&#8203;</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>blackholes.mail-abuse.org</strong>: Rejected - see <a href="http://www.mail-abuse.org/rbl/" class="bare">http://www.mail-abuse.org/rbl/</a></p>
</li>
<li>
<p><strong>dialups.mail-abuse.org</strong>: Dialup - see <a href="http://www.mail-abuse.org/dul/" class="bare">http://www.mail-abuse.org/dul/</a></p>
</li>
<li>
<p><strong>relays.mail-abuse.org</strong>: Open spam relay - see <a href="http://www.mail-abuse.org/rss/" class="bare">http://www.mail-abuse.org/rss/</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="InSpammerBlacklist=blackholes.mail-abuse.org." class="ToProcessor"&gt;
&lt;processor&gt;spam&lt;/processor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_nesspamcheck"><a class="anchor" href="#_nesspamcheck"></a>NESSpamCheck</h3>
<div class="paragraph">
<p>This is based on a sample filter.cfg for a Netscape Mail Server to stop
spam.</p>
</div>
</div>
<div class="sect2">
<h3 id="_senderinfakedomain"><a class="anchor" href="#_senderinfakedomain"></a>SenderInFakeDomain</h3>
<div class="paragraph">
<p>Does a DNS lookup (MX and A/CNAME records) on the sender&#8217;s domain. If there
are no entries, the domain is considered fake and the match is successful.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_composite_matchers"><a class="anchor" href="#_composite_matchers"></a>Composite matchers</h2>
<div class="sectionbody">
<div class="paragraph">
<p>It is possible to combine together matchers in order to create a composite matcher, thus simplifying your
Mailet Container logic.</p>
</div>
<div class="paragraph">
<p>Here are the available logical operations:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>And</strong> : This matcher performs And conjunction between the two matchers: recipients needs to match both matcher in order to
match the composite matcher.</p>
</li>
<li>
<p><strong>Or</strong> : This matcher performs Or conjunction between the two matchers: consider it to be a union of the results.
It returns recipients from the Or composition results of the child matchers.</p>
</li>
<li>
<p><strong>Not</strong> : It returns recipients from the negated composition of the child Matcher(s). Consider what wasn&#8217;t
in the result set of each child matcher. Of course it is easier to understand if it only
includes one matcher in the composition, the normal recommended use.</p>
</li>
<li>
<p><strong>Xor</strong> : It returns Recipients from the Xor composition of the child matchers. Consider it to be the inequality
operator for recipients. If any recipients match other matcher results
then the result does not include that recipient.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Here is the syntax to adopt in <strong>mailetcontainer.xml</strong>:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;processor state="transport" enableJmx="true"&gt;
&lt;matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or"&gt;
&lt;matcher match="SMTPAuthSuccessful"/&gt;
&lt;matcher match="SentByMailet"/&gt;
&lt;matcher match="org.apache.james.jmap.mailet.SentByJmap"/&gt;
&lt;matcher match="RemoteAddrInNetwork=127.0.0.1, 10.2.*, 193.50.151.*"/&gt;
&lt;/matcher&gt;
&lt;!-- ... --&gt;
&lt;mailet match="relay-allowed" class="ToProcessor"&gt;
&lt;processor&gt;relay&lt;/processor&gt;
&lt;/mailet&gt;
&lt;/processor&gt;</pre>
</div>
</div>
</div>
</div>
</article>
</div>
</main>
</div>
<footer class="footer">
<p>This page was built using the Antora default UI.</p>
<p>The source code for this UI is licensed under the terms of the MPL-2.0 license.</p>
</footer>
<script id="site-script" src="../../../_/js/site.js" data-ui-root-path="../../../_"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
</body>
</html>