blob: 64f636ebc3ed4fb2b8d3dc0edeca1529bdd8d7f3 [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; Mailets :: 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-project" data-version="3.6.0">
<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 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="../../../concepts/index.html">Concepts</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../concepts/user/index.html">User Model</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../../concepts/mail/index.html">Emails</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="#mail/messages/index.adoc">mail/messages/index.adoc</a>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="#mail/messages/imf.adoc">mail/messages/imf.adoc</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="#mail/messages/mime.adoc">mail/messages/mime.adoc</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../../concepts/protocols/index.html">Protocols</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/smtp.html">SMTP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/pop.html">POP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/imap.html">IMAP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/jmap.html">JMAP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/esmtp.html">ESMTP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/protocols/lmtp.html">LMTP</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../../concepts/storage/index.html">Storage</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/storage/mailbox.html">Mailboxes</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../concepts/storage/users.html">Users</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../concepts/processing/index.html">Processing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../concepts/configuration.html">Configuration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../concepts/glossary.html">Glossary</a>
</li>
</ul>
</li>
</ul>
</li>
<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">Servers</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../demo.html">Demo</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../5-minute-demo.html">Short Demo</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../15-minute-demo.html">Long Demo</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../basic/index.html">Basic</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/context.html">Context</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/objectives.html">Objectives</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/concepts.html">Concepts</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/architecture.html">Architecture</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/conf/index.html">Configuration</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../basic/help.html">Help</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../extendable.html">Extendable</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../distributed.html">Distributed</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../objectives.html">Objectives and motivation</a>
</li>
<li class="nav-item" data-depth="3">
<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="4">
<a class="nav-link" href="../architecture/consistency-model.html">Consistency Model</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../architecture/specialized-instances.html">Specialized instances</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../run.html">Run</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../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="index.html">Configuration</a>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<button class="nav-item-toggle"></button>
<span class="nav-text">Protocols</span>
<ul class="nav-list">
<li class="nav-item" data-depth="5">
<a class="nav-link" href="imap.html">imapserver.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="jmap.html">jmap.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="jmx.html">jmx.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="smtp.html">smtpserver.xml &amp; lmtpserver.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="smtp-hooks.html">Packaged SMTP hooks</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="pop3.html">pop3server.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="webadmin.html">webadmin.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="ssl.html">SSL &amp; TLS</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="4">
<button class="nav-item-toggle"></button>
<span class="nav-text">Storage dependencies</span>
<ul class="nav-list">
<li class="nav-item" data-depth="5">
<a class="nav-link" href="blobstore.html">blobstore.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="cassandra.html">cassandra.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="elasticsearch.html">elasticsearch.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="rabbitmq.html">rabbitmq.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="tika.html">tika.properties</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="4">
<button class="nav-item-toggle"></button>
<span class="nav-text">Core components</span>
<ul class="nav-list">
<li class="nav-item" data-depth="5">
<a class="nav-link" href="batchsizes.html">batchsizes.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="dns.html">dnsservice.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="domainlist.html">domainlist.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="healthcheck.html">healthcheck.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="mailetcontainer.html">mailetcontainer.xml</a>
</li>
<li class="nav-item is-current-page" data-depth="5">
<a class="nav-link" href="mailets.html">Packaged Mailets</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="matchers.html">Packaged Matchers</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="mailrepositorystore.html">mailrepositorystore.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="recipientrewritetable.html">recipientrewritetable.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="usersrepository.html">usersrepository.xml</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="4">
<button class="nav-item-toggle"></button>
<span class="nav-text">Extensions</span>
<ul class="nav-list">
<li class="nav-item" data-depth="5">
<a class="nav-link" href="vault.html">deletedMessageVault.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="extensions.html">extensions.properties</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="listeners.html">listeners.xml</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="spam.html">Anti-Spam setup</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="remote-delivery-error-handling.html">About RemoteDelivery error handling</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="collecting-contacts.html">Contact collection</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="collecting-events.html">Event collection</a>
</li>
<li class="nav-item" data-depth="5">
<a class="nav-link" href="dsn.html">ESMTP DSN support</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<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="4">
<a class="nav-link" href="../operate/guide.html">Operator guide</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/logging.html">Logging</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/webadmin.html">WebAdmin REST administration API</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/metrics.html">Metrics</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/migrating.html">Migrating existing data</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/cli.html">Command Line Interface</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../operate/cassandra-migration.html">Cassandra migration</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<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="4">
<a class="nav-link" href="../extending/mail-processing.html">Custom mail processing components</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../extending/mailbox-listeners.html">Custom Mailbox Listeners</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../extending/smtp-hooks.html">Custom SMTP hooks</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../extending/webadmin-routes.html">Custom WebAdmin routes</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../test.html">Test</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../../customization/index.html">Customization</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../../development/index.html">Developer Guide</a>
</li>
</ul>
</li>
<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="../../../community/index.html">Community</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/mailing-lists.html">Mailing lists</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/contributing.html">Contributing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/guidelines.html">Guidelines</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/download.html">Download releases</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/website.html">Building and publishing the website</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/release.html">Creating an official Apache James release</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../community/support.html">Professional support</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Apache Software Foundation</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/">ASF</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/getinvolved.html">Get involved</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/faq.html">FAQ</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/licenses/">Licenses</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/security/">Security</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/thanks.html">Thanks</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 Server</span>
<span class="version">3.6.0 Snapshot</span>
</div>
<ul class="components">
<li class="component">
<div class="title"><a href="../../../../../james-distributed-app/3.8.1/index.html">Apache James Distributed Server</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="../../../../../james-distributed-app/3.8.1/index.html">3.8.1 SNAPSHOT</a>
</li>
</ul>
</li>
<li class="component is-current">
<div class="title"><a href="../../../../3.8.1/index.html">Apache James Server</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="../../../../3.8.1/index.html">3.8.1 SNAPSHOT</a>
</li>
<li class="version is-current">
<a href="../../../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 Server</a></li>
<li><a href="../../index.html">Servers</a></li>
<li><a href="../../distributed.html">Distributed</a></li>
<li><a href="index.html">Configuration</a></li>
<li>Core components</li>
<li><a href="mailets.html">Packaged Mailets</a></li>
</ul>
</nav>
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">3.6.0 Snapshot</button>
<div class="version-menu">
<a class="version is-missing" href="../../../../3.8.1/index.html">3.8.1 SNAPSHOT</a>
<a class="version is-current" href="mailets.html">3.6.0 Snapshot</a>
</div>
</div>
<div class="edit-this-page"><a href="https://github.com/apache/james-project/blob/james-project-3.6.0/docs/modules/servers/pages/distributed/configure/mailets.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; Mailets</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This documentation page lists and documents Mailet 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_mailets"><a class="anchor" href="#_supported_mailets"></a>Supported mailets</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_adddeliveredtoheader"><a class="anchor" href="#_adddeliveredtoheader"></a>AddDeliveredToHeader</h3>
<div class="paragraph">
<p>This mailet adds the de-facto standard QMail Delivered-To header.</p>
</div>
<div class="paragraph">
<p>Upon processing by LocalDelivery, a Delivered-To header matching the recipient mail address will be added before storage.</p>
</div>
<div class="paragraph">
<p>Example</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="AddDeliveredToHeader"&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_addfooter"><a class="anchor" href="#_addfooter"></a>AddFooter</h3>
<div class="paragraph">
<p>Takes the message and attaches a footer message to it. Right now, it only
supports simple messages. Needs to have additions to make it support
messages with alternate content types or with attachments.</p>
</div>
</div>
<div class="sect2">
<h3 id="_addsubjectprefix"><a class="anchor" href="#_addsubjectprefix"></a>AddSubjectPrefix</h3>
<div class="paragraph">
<p>Add an prefix (tag) to the subject of a message &lt;br&gt;</p>
</div>
<div class="paragraph">
<p>Sample Configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIs=robot@james.apache.org" class="TagMessage"&gt;
&lt;subjectPrefix&gt;[robot]&lt;/subjectPrefix&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_amqpforwardattribute"><a class="anchor" href="#_amqpforwardattribute"></a>AmqpForwardAttribute</h3>
<div class="paragraph">
<p>This mailet forwards the attributes values to a AMPQ.</p>
</div>
<div class="paragraph">
<p>It takes 4 parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>attribute (mandatory): content to be forwarded, expected to be a Map&lt;String, byte[]&gt;
where the byte[] content is issued from a MimeBodyPart.
It is typically generated from the StripAttachment mailet.</p>
</li>
<li>
<p>uri (mandatory): AMQP URI defining the server where to send the attachment.</p>
</li>
<li>
<p>exchange (mandatory): name of the AMQP exchange.</p>
</li>
<li>
<p>routing_key (optional, default to empty string): name of the routing key on this exchange.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This mailet will sent the data attached to the mail as an attribute holding a map.</p>
</div>
</div>
<div class="sect2">
<h3 id="_bounce"><a class="anchor" href="#_bounce"></a>Bounce</h3>
<div class="paragraph">
<p>Generates a response to the reverse-path address. Note that this is different
than a mail-client&#8217;s reply, which would use the Reply-To or From header.</p>
</div>
<div class="paragraph">
<p>Bounced messages are attached in their entirety (headers and content) and the
resulting MIME part type is "message/rfc822".</p>
</div>
<div class="paragraph">
<p>The reverse-path and the Return-Path header of the response is set to "null"
("&lt;&gt;"), meaning that no reply should be sent.</p>
</div>
<div class="paragraph">
<p>A sender of the notification message can optionally be specified. If one is
not specified, the postmaster&#8217;s address will be used.</p>
</div>
<div class="paragraph">
<p>A notice text can be specified, and in such case will be inserted into the
notification inline text.</p>
</div>
<div class="paragraph">
<p>If the notified message has an "error message" set, it will be inserted into
the notification inline text. If the <strong>attachError</strong> init
parameter is set to true, such error message will be attached to the
notification message.</p>
</div>
<div class="paragraph">
<p>Supports the <strong>passThrough</strong> init parameter (true if missing).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Bounce"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered, default=postmaster*&lt;/sender&gt;
&lt;attachError&gt;*true or false, default=false*&lt;/attachError&gt;
&lt;message&gt;*notice attached to the original message text (optional)*&lt;/message&gt;
&lt;prefix&gt;*optional subject prefix prepended to the original message*&lt;/prefix&gt;
&lt;inline&gt;*default=none*&lt;/inline&gt;
&lt;attachment&gt;*default=message*&lt;/attachment&gt;
&lt;passThrough&gt;*true or false, default=true*&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false, default=true*&lt;/fakeDomainCheck&gt;
&lt;debug&gt;*true or false, default=false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The behaviour of this mailet is equivalent to using Resend with the following
configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Resend"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered*&lt;/sender&gt;
&lt;attachError&gt;*true or false*&lt;/attachError&gt;
&lt;message&gt;**dynamically built**&lt;/message&gt;
&lt;prefix&gt;*a string*&lt;/prefix&gt;
&lt;passThrough&gt;true or false&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false*&lt;/fakeDomainCheck&gt;
&lt;recipients&gt;*sender*&lt;/recipients&gt;
&lt;reversePath&gt;null&lt;/reversePath&gt;
&lt;inline&gt;see Resend&lt;/inline&gt;
&lt;attachment&gt;see Resend&lt;/attachment&gt;
&lt;isReply&gt;true&lt;/isReply&gt;
&lt;debug&gt;*true or false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>notice</strong> and <strong>sendingAddress</strong> can be used instead of <strong>message</strong>
and <strong>sender</strong>; such names are kept for backward compatibility.</p>
</div>
</div>
<div class="sect2">
<h3 id="_contactextractor"><a class="anchor" href="#_contactextractor"></a>ContactExtractor</h3>
<div class="paragraph">
<p>Collects the sender and the recipients of a message and store them as JSON in a
specified message attribute.</p>
</div>
<div class="paragraph">
<p>Here is the JSON format:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>{
"userEmail" : "sender@james.org",
"emails" : [ "to@james.org", "cc@james.org" ]
}</pre>
</div>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="ContactExtractor"&gt;
&lt;attribute&gt;ExtractedContacts&lt;/attribute&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_convertto7bit"><a class="anchor" href="#_convertto7bit"></a>ConvertTo7Bit</h3>
<div class="paragraph">
<p>Make sure the message stream is 7bit. Every 8bit part is encoded to
quoted-printable or base64 and the message is saved.</p>
</div>
</div>
<div class="sect2">
<h3 id="_dkimsign"><a class="anchor" href="#_dkimsign"></a>DKIMSign</h3>
<div class="paragraph">
<p>This mailet sign a message using the DKIM protocol
If the privateKey is encoded using a password then you can pass
the password as privateKeyPassword parameter.</p>
</div>
<div class="paragraph">
<p>Sample configuration with inlined private key:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=&amp;quot;All&amp;quot; class=&amp;quot;DKIMSign&amp;quot;&gt;
&lt;signatureTemplate&gt;v=1; s=selector; d=example.com; h=from:to:received:received; a=rsa-sha256; bh=; b=;&lt;/signatureTemplate&gt;
&lt;privateKey&gt;
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDYDaYKXzwVYwqWbLhmuJ66aTAN8wmDR+rfHE8HfnkSOax0oIoT
M5zquZrTLo30870YMfYzxwfB6j/Nz3QdwrUD/t0YMYJiUKyWJnCKfZXHJBJ+yfRH
r7oW+UW3cVo9CG2bBfIxsInwYe175g9UjyntJpWueqdEIo1c2bhv9Mp66QIDAQAB
AoGBAI8XcwnZi0Sq5N89wF+gFNhnREFo3rsJDaCY8iqHdA5DDlnr3abb/yhipw0I
/1HlgC6fIG2oexXOXFWl+USgqRt1kTt9jXhVFExg8mNko2UelAwFtsl8CRjVcYQO
cedeH/WM/mXjg2wUqqZenBmlKlD6vNb70jFJeVaDJ/7n7j8BAkEA9NkH2D4Zgj/I
OAVYccZYH74+VgO0e7VkUjQk9wtJ2j6cGqJ6Pfj0roVIMUWzoBb8YfErR8l6JnVQ
bfy83gJeiQJBAOHk3ow7JjAn8XuOyZx24KcTaYWKUkAQfRWYDFFOYQF4KV9xLSEt
ycY0kjsdxGKDudWcsATllFzXDCQF6DTNIWECQEA52ePwTjKrVnLTfCLEG4OgHKvl
Zud4amthwDyJWoMEH2ChNB2je1N4JLrABOE+hk+OuoKnKAKEjWd8f3Jg/rkCQHj8
mQmogHqYWikgP/FSZl518jV48Tao3iXbqvU9Mo2T6yzYNCCqIoDLFWseNVnCTZ0Q
b+IfiEf1UeZVV5o4J+ECQDatNnS3V9qYUKjj/krNRD/U0+7eh8S2ylLqD3RlSn9K
tYGRMgAtUXtiOEizBH6bd/orzI9V9sw8yBz+ZqIH25Q=
-----END RSA PRIVATE KEY-----
&lt;/privateKey&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Sample configuration with file-provided private key:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=&amp;quot;All&amp;quot; class=&amp;quot;DKIMSign&amp;quot;&gt;
&lt;signatureTemplate&gt;v=1; s=selector; d=example.com; h=from:to:received:received; a=rsa-sha256; bh=; b=;&lt;/signatureTemplate&gt;
&lt;privateKeyFilepath&gt;dkim-signing.pem&lt;/privateKeyFilepath&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>By default the mailet assume that Javamail will convert LF to CRLF when sending
so will compute the hash using converted newlines. If you don&#8217;t want this
behaviour then set forceCRLF attribute to false.</p>
</div>
</div>
<div class="sect2">
<h3 id="_dkimverify"><a class="anchor" href="#_dkimverify"></a>DKIMVerify</h3>
<div class="paragraph">
<p>This mailet verify a message using the DKIM protocol</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="DKIMVerify"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>By default the mailet assume that Javamail will use LF instead of CRLF
so it will verify the hash using converted newlines. If you don&#8217;t want this
behaviour then set forceCRLF attribute to false.</p>
</div>
</div>
<div class="sect2">
<h3 id="_dsnbounce"><a class="anchor" href="#_dsnbounce"></a>DSNBounce</h3>
<div class="paragraph">
<p>Generates a Delivery Status Notification (DSN) Note that this is different
than a mail-client&#8217;s reply, which would use the Reply-To or From header.</p>
</div>
<div class="paragraph">
<p>Bounced messages are attached in their entirety (headers and content) and the
resulting MIME part type is "message/rfc822".</p>
</div>
<div class="paragraph">
<p>The reverse-path and the Return-Path header of the response is set to "null"
("&lt;&gt;"), meaning that no reply should be sent.</p>
</div>
<div class="paragraph">
<p>A sender of the notification message can optionally be specified. If one is
not specified, the postmaster&#8217;s address will be used.</p>
</div>
<div class="paragraph">
<p>Supports the &lt;code&gt;passThrough&lt;/code&gt; init parameter (true if missing).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="DSNBounce"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered, default=postmaster*&lt;/sender&gt;
&lt;prefix&gt;*optional subject prefix prepended to the original message*&lt;/prefix&gt;
&lt;attachment&gt;*message, heads or none, default=message*&lt;/attachment&gt;
&lt;messageString&gt;*the message sent in the bounce, the first occurrence of the pattern [machine] is replaced with the name of the executing machine, default=Hi. This is the James mail server at [machine] ... *&lt;/messageString&gt;
&lt;passThrough&gt;*true or false, default=true*&lt;/passThrough&gt;
&lt;debug&gt;*true or false, default=false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_extractmdnoriginaljmapmessageid"><a class="anchor" href="#_extractmdnoriginaljmapmessageid"></a>ExtractMDNOriginalJMAPMessageId</h3>
<div class="paragraph">
<p>This mailet handles MDN messages and define a header X-JAMES-MDN-JMAP-MESSAGE-ID referencing
the original message (by its Jmap Id) asking for the recipient to send an MDN.</p>
</div>
</div>
<div class="sect2">
<h3 id="_forward"><a class="anchor" href="#_forward"></a>Forward</h3>
<div class="paragraph">
<p>Replaces incoming recipients with those specified, and resends the message
unaltered.</p>
</div>
<div class="paragraph">
<p>Can be totally replaced by an equivalent usage of {@link Resend} (see below),
simply replacing <strong>&lt;forwardto&gt;</strong> with <strong>&lt;recipients&gt;</strong>.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Forward"&gt;
&lt;forwardTo&gt;*comma delimited list of email addresses*&lt;/forwardTo&gt;
&lt;passThrough&gt;*true or false, default=false*&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false, default=true*&lt;/fakeDomainCheck&gt;
&lt;debug&gt;*true or false, default=false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The behaviour of this mailet is equivalent to using Resend with the following
configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Resend"&gt;
&lt;forwardTo&gt;comma delimited list of email addresses&lt;/recipients&gt;
&lt;passThrough&gt;true or false&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false*&lt;/fakeDomainCheck&gt;
&lt;debug&gt;*true or false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>forwardto</strong> can be used instead of <strong>forwardTo</strong>; such name is kept
for backward compatibility.</p>
</div>
</div>
<div class="sect2">
<h3 id="_icalendarparser"><a class="anchor" href="#_icalendarparser"></a>ICalendarParser</h3>
<div class="paragraph">
<p>This mailet can be combined with the Strip attachment mailet.</p>
</div>
<div class="paragraph">
<p>The ICS body part byte array is arranged as map then this mailet should look for ICS and parse it
with Ical4J then store it as a mail attribute</p>
</div>
<div class="paragraph">
<p>Configuration: The mailet contains 2 mandatory attributes</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="ICalendarParser" &gt;
&lt;sourceAttribute&gt;source.attribute.name&lt;/sourceAttribute&gt;
&lt;!-- The attribute which contains output value of StripAttachment mailet -- &gt;
&lt;destAttribute&gt;dest.attribute.name&lt;/destAttribute&gt;
&lt;!-- The attribute store the map of Calendar -- &gt;
&lt;/mailet &gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_icaltoheader"><a class="anchor" href="#_icaltoheader"></a>ICALToHeader</h3>
<div class="paragraph">
<p>ICALToHeader takes a Map of filenames to ICAL4J calendars, will pick the first Calendar,
and add it to the headers of the e-mail.</p>
</div>
<div class="paragraph">
<p>The following headers will be added : X_MEETING_UID, X_MEETING_METHOD, X_MEETING_RECURRENCE_ID, X_MEETING_SEQUENCE,
X_MEETING_DTSTAMP</p>
</div>
<div class="paragraph">
<p>The only configuration parameter for this mailet is the attribute the ICAL4J Calendar map should be attached to,
named <strong>attribute</strong>.</p>
</div>
<div class="paragraph">
<p>Configuration example :</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=??? class=ICALToHeader&gt;
&lt;attribute&gt;icalendars&lt;/attribute&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_icaltojsonattribute"><a class="anchor" href="#_icaltojsonattribute"></a>ICALToJsonAttribute</h3>
<div class="paragraph">
<p>ICALToJsonAttribute takes a map of ICAL4J objects attached as attribute, and
output the map of corresponding json bytes as an other attribute, with unique String keys.</p>
</div>
<div class="paragraph">
<p>The JSON contains the following fields :</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ical</strong> : the raw ical string, in UTF-8</p>
</li>
<li>
<p><strong>sender</strong> : the sender of the mail (compulsory, mail without sender will be discarded)</p>
</li>
<li>
<p><strong>recipient</strong> : the recipient of the mail. If the mail have several recipients, each recipient will have its own JSON.</p>
</li>
<li>
<p><strong>uid</strong> : the UID of the ical (optional)</p>
</li>
<li>
<p><strong>sequence</strong> : the sequence of the ical (optional)</p>
</li>
<li>
<p><strong>dtstamp</strong> : the date stamp of the ical (optional)</p>
</li>
<li>
<p><strong>method</strong> : the method of the ical (optional)</p>
</li>
<li>
<p><strong>recurrence-id</strong> : the recurrence-id of the ical (optional)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Example are included in test call ICalToJsonAttributeTest.</p>
</div>
<div class="paragraph">
<p>Configuration example :</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=??? class=ICALToJsonAttribute&gt;
&lt;sourceAttribute&gt;icalendars&lt;/sourceAttribute&gt;
&lt;destinationAttribute&gt;icalendarJson&lt;/destinationAttribute&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_icssanitizer"><a class="anchor" href="#_icssanitizer"></a>ICSSanitizer</h3>
<div class="paragraph">
<p>Some senders embed 'text/calendar' content as part of Mime bodypart headers with an empty body.</p>
</div>
<div class="paragraph">
<p>This mailet duplicate the 'text/calendar' content to the Mime body part.</p>
</div>
<div class="paragraph">
<p>Example configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="ICSSanitizer"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_localdelivery"><a class="anchor" href="#_localdelivery"></a>LocalDelivery</h3>
<div class="paragraph">
<p>Receives a Mail from the Queue and takes care of delivery of the
message to local inboxes.</p>
</div>
</div>
<div class="sect2">
<h3 id="_logmessage"><a class="anchor" href="#_logmessage"></a>LogMessage</h3>
<div class="paragraph">
<p>Logs Message Headers and/or Body.
If the "passThrough" in confs is true the mail will be left untouched in
the pipe. If false will be destroyed. Default is true.</p>
</div>
</div>
<div class="sect2">
<h3 id="_mailattributeslisttomimeheaders"><a class="anchor" href="#_mailattributeslisttomimeheaders"></a>MailAttributesListToMimeHeaders</h3>
<div class="paragraph">
<p>Convert attributes of type Collection&lt;String&gt; to headers</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="MailAttributesToMimeHeaders"&gt;
&lt;simplemapping&gt;org.apache.james.attribute1;headerName1&lt;/simplemapping&gt;
&lt;simplemapping&gt;org.apache.james.attribute2;headerName2&lt;/simplemapping&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_mailattributestomimeheaders"><a class="anchor" href="#_mailattributestomimeheaders"></a>MailAttributesToMimeHeaders</h3>
<div class="paragraph">
<p>Convert attributes of type Collection&lt;String&gt; to headers</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="MailAttributesToMimeHeaders"&gt;
&lt;simplemapping&gt;org.apache.james.attribute1;headerName1&lt;/simplemapping&gt;
&lt;simplemapping&gt;org.apache.james.attribute2;headerName2&lt;/simplemapping&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_metricsmailet"><a class="anchor" href="#_metricsmailet"></a>MetricsMailet</h3>
<div class="paragraph">
<p>This Metrics mailet increments a counter on every incoming emails.</p>
</div>
<div class="paragraph">
<p>This counter is accessible via JMX, or grafana. Read <a href="../operate/metrics.html" class="xref page">more about metrics</a>.</p>
</div>
<div class="paragraph">
<p>Example :</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="all" class="MetricsMailet"&gt;
&lt;metricName&gt;relayDenied&lt;/metricName&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>Will increment a counter relayDenied</p>
</div>
</div>
<div class="sect2">
<h3 id="_mailattributestomimeheaders_2"><a class="anchor" href="#_mailattributestomimeheaders_2"></a>MailAttributesToMimeHeaders</h3>
<div class="paragraph">
<p>This mailet replace the mail attribute map of key to MimePart
by a map of key to the MimePart content (as bytes).</p>
</div>
<div class="paragraph">
<p>It takes only one parameter:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>attribute (mandatory): mime content to be decoded, expected to be a Map&lt;String, byte[]&gt;</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Then all this map attribute values will be replaced by their content.</p>
</div>
</div>
<div class="sect2">
<h3 id="_notifypostmaster"><a class="anchor" href="#_notifypostmaster"></a>NotifyPostmaster</h3>
<div class="paragraph">
<p>Sends a notification message to the Postmaster.</p>
</div>
<div class="paragraph">
<p>A sender of the notification message can optionally be specified. If one is
not specified, the postmaster&#8217;s address will be used.</p>
</div>
<div class="paragraph">
<p>The "To:" header of the notification message can be set to "unaltered"; if
missing will be set to the postmaster.</p>
</div>
<div class="paragraph">
<p>A notice text can be specified, and in such case will be inserted into the
notification inline text.</p>
</div>
<div class="paragraph">
<p>If the notified message has an "error message" set, it will be inserted into
the notification inline text. If the <strong>attachError</strong> init
parameter is set to true, such error message will be attached to the
notification message.</p>
</div>
<div class="paragraph">
<p>The notified messages are attached in their entirety (headers and content)
and the resulting MIME part type is "message/rfc822".</p>
</div>
<div class="paragraph">
<p>Supports the <strong>passThrough</strong> init parameter (true if missing).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="NotifyPostmaster"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered, default=postmaster*&lt;/sender&gt;
&lt;attachError&gt;*true or false, default=false*&lt;/attachError&gt;
&lt;message&gt;*notice attached to the original message text (optional)*&lt;/message&gt;
&lt;prefix&gt;*optional subject prefix prepended to the original message, default="Re:"*&lt;/prefix&gt;
&lt;inline&gt;*default=none*&lt;/inline&gt;
&lt;attachment&gt;*default=message*&lt;/attachment&gt;
&lt;passThrough&gt;*true or false, default=true*&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false, default=true*&lt;/fakeDomainCheck&gt;
&lt;to&gt;*unaltered (optional, defaults to postmaster)*&lt;/to&gt;
&lt;debug&gt;*true or false, default=false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The behaviour of this mailet is equivalent to using Resend with the following
configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Resend"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered*&lt;/sender&gt;
&lt;attachError&gt;*true or false*&lt;/attachError&gt;
&lt;message&gt;*&lt;b&gt;dynamically built&lt;/b&gt;*&lt;/message&gt;
&lt;prefix&gt;*a string*&lt;/prefix&gt;
&lt;passThrough&gt;*true or false*&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false*&lt;/fakeDomainCheck&gt;
&lt;to&gt;*&lt;b&gt;unaltered or postmaster&lt;/b&gt;*&lt;/to&gt;
&lt;recipients&gt;&lt;b&gt;postmaster&lt;/b&gt;&lt;/recipients&gt;
&lt;inline&gt;see {@link Resend}&lt;/inline&gt;
&lt;attachment&gt;see {@link Resend}&lt;/attachment&gt;
&lt;isReply&gt;true&lt;/isReply&gt;
&lt;debug&gt;*true or false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>notice</strong>, <strong>sendingAddress</strong> and <strong>attachError</strong> can be used
instead of <strong>message</strong>, <strong>sender</strong> and <strong>attachError</strong>; such names
are kept for backward compatibility.</p>
</div>
</div>
<div class="sect2">
<h3 id="_notifysender"><a class="anchor" href="#_notifysender"></a>NotifySender</h3>
<div class="paragraph">
<p>Sends a notification message to the sender of a message.</p>
</div>
<div class="paragraph">
<p>A sender of the notification message can optionally be specified. If one is
not specified, the postmaster&#8217;s address will be used.</p>
</div>
<div class="paragraph">
<p>The "To:" header of the notification message can be set to "unaltered"; if
missing will be set to the sender of the notified message.</p>
</div>
<div class="paragraph">
<p>A notice text can be specified, and in such case will be inserted into the
notification inline text.</p>
</div>
<div class="paragraph">
<p>If the notified message has an "error message" set, it will be inserted into
the notification inline text. If the <strong>attachError</strong> init
parameter is set to true, such error message will be attached to the
notification message.</p>
</div>
<div class="paragraph">
<p>The notified messages are attached in their entirety (headers and content)
and the resulting MIME part type is "message/rfc822".</p>
</div>
<div class="paragraph">
<p>Supports the <strong>passThrough</strong> init parameter (true if missing).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="NotifySender"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered, default=postmaster*&lt;/sender&gt;
&lt;attachError&gt;*true or false, default=false*&lt;/attachError&gt;
&lt;prefix&gt;*optional subject prefix prepended to the original message*&lt;/prefix&gt;
&lt;inline&gt;default=none*&lt;/inline&gt;
&lt;attachment&gt;default=message*&lt;/attachment&gt;
&lt;passThrough&gt;*true or false, default=true*&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false, default=true*&lt;/fakeDomainCheck&gt;
&lt;to&gt;*unaltered or sender or from(optional, defaults to sender)*&lt;/to&gt;
&lt;debug&gt;*true or false, default=false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The behaviour of this mailet is equivalent to using Resend with the following
configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="Resend"&gt;
&lt;sender&gt;*an address or postmaster or sender or unaltered*&lt;/sender&gt;
&lt;attachError&gt;*true or false*&lt;/attachError&gt;
&lt;message&gt;*&lt;b&gt;dynamically built&lt;/b&gt;*&lt;/message&gt;
&lt;prefix&gt;*a string*&lt;/prefix&gt;
&lt;passThrough&gt;true&lt;/passThrough&gt;
&lt;fakeDomainCheck&gt;*true or false*&lt;/fakeDomainCheck&gt;
&lt;to&gt;*unaltered or sender or from&amp;lt*;/to&gt;
&lt;recipients&gt;&lt;b&gt;sender&lt;/b&gt;&lt;/recipients&gt;
&lt;inline&gt;none&lt;/inline&gt;
&lt;attachment&gt;message&lt;/attachment&gt;
&lt;isReply&gt;true&lt;/isReply&gt;
&lt;debug&gt;*true or false*&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>notice</strong>, <strong>sendingAddress</strong> and <strong>attachError</strong> can be used
instead of <strong>message</strong>, <strong>sender</strong> and <strong>attachError</strong>; such names
are kept for backward compatibility.</p>
</div>
</div>
<div class="sect2">
<h3 id="_null"><a class="anchor" href="#_null"></a>Null</h3>
<div class="paragraph">
<p>Simplest Mailet which destroys any incoming messages by setting their state to GHOST.</p>
</div>
<div class="paragraph">
<p>This effectively stops all processing of this mail.</p>
</div>
</div>
<div class="sect2">
<h3 id="_postmasteralias"><a class="anchor" href="#_postmasteralias"></a>PostmasterAlias</h3>
<div class="paragraph">
<p>Rewrites recipient addresses to make sure email for the postmaster is
always handled. This mailet is silently inserted at the top of the root
spool processor. All recipients mapped to postmaster@&lt;servernames&gt; are
changed to the postmaster account as specified in the server conf.</p>
</div>
</div>
<div class="sect2">
<h3 id="_randomstoring"><a class="anchor" href="#_randomstoring"></a>RandomStoring</h3>
<div class="paragraph">
<p>Process messages and randomly assign them to 4 to 8 mailboxes.</p>
</div>
</div>
<div class="sect2">
<h3 id="_recipientrewritetable"><a class="anchor" href="#_recipientrewritetable"></a>RecipientRewriteTable</h3>
<div class="paragraph">
<p>Mailet which should get used when using RecipientRewriteTable-Store to
implementations for mappings of forwards and aliases.</p>
</div>
<div class="paragraph">
<p>By specifying an 'errorProcessor' you can specify your logic upon RecipientRewriteTable failures.</p>
</div>
<div class="paragraph">
<p>Exemple:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="RecipientRewriteTable"&gt;
&lt;errorProcessor&gt;rrt-errors&lt;/errorProcessor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_recipienttolowercase"><a class="anchor" href="#_recipienttolowercase"></a>RecipientToLowerCase</h3>
<div class="paragraph">
<p>GenericMailet which convert all Recipients to lowercase.</p>
</div>
</div>
<div class="sect2">
<h3 id="_redirect"><a class="anchor" href="#_redirect"></a>Redirect</h3>
<div class="paragraph">
<p>A mailet providing configurable redirection services.</p>
</div>
<div class="paragraph">
<p>Can produce listserver, forward and notify behaviour, with the original
message intact, attached, appended or left out altogether.</p>
</div>
<div class="paragraph">
<p>It differs from Resend because (i) some defaults are different,
notably for the following parameters: <strong>&lt;recipients&gt;</strong>,
<strong>&lt;to&gt;</strong>, <strong>&lt;reversePath&gt;</strong> and <strong>&lt;inline&gt;</strong>; (ii)
because it allows the use of the <strong>&lt;static&gt;</strong> parameter;.</p>
</div>
<div class="paragraph">
<p>Use &lt;code&gt;Resend&lt;/code&gt; if you need full control, &lt;code&gt;Redirect&lt;/code&gt; if
the more automatic behaviour of some parameters is appropriate.</p>
</div>
<div class="paragraph">
<p>This built in functionality is controlled by the configuration as laid out
below. In the table please note that the parameters controlling message
headers accept the &lt;b&gt;"unaltered"&lt;/b&gt; value, whose meaning is to
keep the associated header unchanged and, unless stated differently,
corresponds to the assumed default if the parameter is missing.</p>
</div>
<div class="paragraph">
<p>The configuration parameters are:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 1. Redirect parameters</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Property name</th>
<th class="tableblock halign-left valign-top">explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">recipients</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A comma delimited list of addresses for recipients of this message; it will
use the "to" list if not specified, and "unaltered" if
none of the lists is specified.</p>
<p class="tableblock">These addresses will only appear in the To: header if no "to" list
is supplied.</p>
<p class="tableblock">Such addresses can contain "full names", like <strong>Mr. John D. Smith
&lt;<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>&gt;</strong>.</p>
<p class="tableblock">The list can include constants "sender", "from",
"replyTo", "postmaster", "reversePath",
"recipients", "to", "null" and
"unaltered"; "replyTo" uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path; "from" is made
equivalent to "sender", and "to" is made equivalent to
"recipients"; "null" is ignored.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">to</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A comma delimited list of addresses to appear in the To: header; the email
will be delivered to any of these addresses if it is also in the recipients
list.</p>
<p class="tableblock">The recipients list will be used if this list is not supplied; if none of the
lists is specified it will be "unaltered".</p>
<p class="tableblock">Such addresses can contain "full names", like <strong>Mr. John D. Smith
&lt;<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>&gt;</strong>.</p>
<p class="tableblock">The list can include constants "sender", "from",
"replyTo", "postmaster", "reversePath",
"recipients", "to", "null" and
"unaltered"; "from" uses the From header if available,
otherwise the Sender header if available, otherwise the return-path;
"replyTo" uses the ReplyTo header if available, otherwise the From
header if available, otherwise the Sender header if available, otherwise the
return-path; "recipients" is made equivalent to "to"; if
"null" is specified alone it will remove this header.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">sender</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">single email address to appear in the From: and Return-Path: headers and
become the sender.</p>
<p class="tableblock">It can include constants "sender", "postmaster" and
"unaltered"; "sender" is equivalent to
"unaltered".</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">message</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A text message to insert into the body of the email.</p>
<p class="tableblock">Default: no message is inserted.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">inline</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One of the following items:</p>
<p class="tableblock">* unaltered &nbsp;&nbsp;&nbsp;&nbsp;The original message is the new
message, for forwarding/aliasing
* heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
headers of the original message are appended to the message
* body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
body of the original is appended to the new message
*
all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;nbsp
;&nbsp;&nbsp;&nbsp;Both headers and body are appended
* none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Neither body nor headers are appended
&lt;/ul&gt;
Default: "body".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">attachment</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One of the following items:</p>
<p class="tableblock">* heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The headers of the original are
attached as text
* body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The body of the original is
attached as text
* all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
headers and body are attached as a single text file
* none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nothing is attached
* message &nbsp;The original message is attached as type message/rfc822,
this means that it can, in many cases, be opened, resent, fw&#8217;d, replied to
etc by email client software.</p>
<p class="tableblock">Default: "none".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">passThrough</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true the original message continues in the mailet processor
after this mailet is finished. False causes the original to be stopped.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fakeDomainCheck</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true will check if the sender domain is valid.</p>
<p class="tableblock">Default: true.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">attachError</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true any error message available to the mailet is appended
to the message body (except in the case of inline == unaltered).</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">replyTo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A single email address to appear in the Reply-To: header.</p>
<p class="tableblock">It can include constants "sender", "postmaster"
"null" and "unaltered"; if "null" is specified
it will remove this header.</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">reversePath</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A single email address to appear in the Return-Path: header.</p>
<p class="tableblock">It can include constants "sender", "postmaster" and
"null"; if "null" is specified then it will set it to &lt;&gt;,
meaning "null return path".</p>
<p class="tableblock">Notice: the "unaltered" value is <strong>not allowed</strong>.</p>
<p class="tableblock">Default: the value of the <strong>&lt;sender&gt;</strong> parameter, if set, otherwise
remains unaltered.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">subject</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">An optional string to use as the subject.</p>
<p class="tableblock">Default: keep the original message subject.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">prefix</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">An optional subject prefix prepended to the original message subject, or to a
new subject specified with the <strong>&lt;subject&gt;</strong> parameter.</p>
<p class="tableblock">For example: <strong>[Undeliverable mail]</strong>.</p>
<p class="tableblock">Default: ".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">isReply</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true the IN_REPLY_TO header will be set to the id of the
current message.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">debug</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false. If this is true it tells the mailet to write some debugging
information to the mailet log.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">static</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false. If this is true it tells the mailet that it can reuse all the
initial parameters (to, from, etc) without re-calculating their values. This
will boost performance where a redirect task doesn&#8217;t contain any dynamic
values. If this is false, it tells the mailet to recalculate the values for
each e-mail processed.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="RecipientIs=test@localhost" class="Redirect"&gt;
&lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;
&lt;to&gt;list@localhost&lt;/to&gt;
&lt;sender&gt;owner@localhost&lt;/sender&gt;
&lt;message&gt;sent on from James&lt;/message&gt;
&lt;inline&gt;unaltered&lt;/inline&gt;
&lt;passThrough&gt;FALSE&lt;/passThrough&gt;
&lt;replyTo&gt;postmaster&lt;/replyTo&gt;
&lt;prefix xml:space="preserve"&gt;[test mailing] &lt;/prefix&gt;
&lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;
&lt;static&gt;TRUE&lt;/static&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>and:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="Redirect"&gt;
&lt;recipients&gt;x@localhost&lt;/recipients&gt;
&lt;sender&gt;postmaster&lt;/sender&gt;
&lt;message xml:space="preserve"&gt;Message marked as spam:&lt;/message&gt;
&lt;inline&gt;heads&lt;/inline&gt;
&lt;attachment&gt;message&lt;/attachment&gt;
&lt;passThrough&gt;FALSE&lt;/passThrough&gt;
&lt;attachError&gt;TRUE&lt;/attachError&gt;
&lt;replyTo&gt;postmaster&lt;/replyTo&gt;
&lt;prefix&gt;[spam notification]&lt;/prefix&gt;
&lt;static&gt;TRUE&lt;/static&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>replyto</strong> can be used instead of <strong>replyTo</strong>; such name is kept for
backward compatibility.</p>
</div>
</div>
<div class="sect2">
<h3 id="_remotedelivery"><a class="anchor" href="#_remotedelivery"></a>RemoteDelivery</h3>
<div class="paragraph">
<p>The RemoteDelivery mailet delivers messages to a remote SMTP server able to deliver or forward messages to their final
destination.</p>
</div>
<div class="paragraph">
<p>The remote SMTP server through which each mail is delivered is resolved using MX lookup for each message destination
unless the <strong>&lt;gateway/&gt;</strong> parameter is set. The <strong>&lt;gateway/&gt;</strong> parameter enables the
definition of one or more gateway servers through which all messages are sent.</p>
</div>
<div class="paragraph">
<p>If an attempt to deliver a message fails, a redelivery attempt is scheduled according to the scheme defined
by the <strong>&lt;delayTime/&gt;</strong> parameter, retrying up to the limit defined
by the <strong>&lt;maxRetries/&gt;</strong> parameter. When the retry limit is exceeded, delivery failure is processed
according to the setting of the <strong>&lt;bounceProcessor/&gt;</strong> parameter.</p>
</div>
<div class="paragraph">
<p>These are the parameters that control the operation of the RemoteDelivery mailet:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>outgoing</strong> (required) - a String containing the name of the queue that will hold messages being processed by this mailet.</p>
</li>
<li>
<p><strong>bind</strong> (optional) - a String describing the local IP address to which the mailet should be bound while delivering
emails. This tag is useful for multihomed machines. Default is to bind to the default local address of the machine.&lt;br&gt;
Note: The same IP address must be used for all of those RemoteDelivery instances where you explicitly supply a bind address.</p>
</li>
<li>
<p><strong>delayTime</strong> (optional) a String containing a comma separated list of patterns defining the number of and delays between delivery
attempts. The pattern is <strong>[attempts\</strong>]delay [unit]* where:</p>
<div class="ulist">
<ul>
<li>
<p><strong>attempts</strong> (optional) - an Integer for the number of delivery attempts. Default is 1.</p>
</li>
<li>
<p><strong>delay</strong> (required) - a Long for the delay between attempts.</p>
</li>
<li>
<p><strong>unit</strong> (optional) - a String with the value of one of 'msec', 'sec', 'minute', 'hour', or 'day'. Default is msec.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>Default is one attempt after 6 hours, which if explicitly declared would be written as <strong>&lt;delayTime&gt;1 6 hour&lt;/delayTime&gt;</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>maxRetries</strong> (optional) an Integer for the number of times an attempt is made to deliver a particular mail.
Default is the greater of five and the sum of the attempts for each <strong>&lt;delayTime/&gt;</strong> specified.</p>
</li>
<li>
<p><strong>maxDnsProblemRetries</strong> (optional) - an Integer for the number of times to retry if DNS problems for a domain occur.
Default is 0.</p>
</li>
<li>
<p><strong>timeout</strong> (optional) - an Integer for the Socket I/O timeout in milliseconds. Default is 180000</p>
</li>
<li>
<p><strong>connectionTimeout</strong> (optional) - an Integer for the Socket connection timeout in milliseconds. Default is 60000</p>
</li>
<li>
<p><strong>bounceProcessor</strong> (optional) - a String containing the name of the mailet processor to pass messages that cannot
be delivered to for DSN bounce processing. Default is to send a traditional message containing the bounce details.</p>
</li>
<li>
<p><strong>startTLS</strong> (optional) - a Boolean (true/false) indicating whether the STARTTLS command (if supported by the server)
to switch the connection to a TLS-protected connection before issuing any login commands. Default is false.</p>
</li>
<li>
<p><strong>sslEnable</strong> (optional) - a Boolean (true/false) indicating whether to use SSL to connect and use the SSL port unless
explicitly overridden. Default is false.</p>
</li>
<li>
<p><strong>gateway</strong> (optional) - a String containing a comma separated list of patterns defining the gateway servers to be used to
deliver mail regardless of the recipient address. If multiple gateway servers are defined, each will be tried in definition order
until delivery is successful. If none are successful, the mail is bounced. The pattern is <strong>host[:port]</strong> where:</p>
</li>
<li>
<p><strong>host</strong> (required) - the FQN of the gateway server.</p>
</li>
<li>
<p><strong>port</strong> (optional) - the port of the gateway server. Default is the value defined in the <strong>&lt;gatewayPort/&gt;</strong>
parameter if set, else the default port for the specified connection type.
Default is to resolve the destination SMTP server for each mail using MX lookup.</p>
</li>
<li>
<p><strong>gatewayPort</strong> (optional) - an Integer for the gateway port to be used for each defined gateway server for which a
port is not explicitly defined in the <strong>&lt;gateway/&gt;</strong> parameter. Default is the default port for the specified connection type.</p>
</li>
<li>
<p><strong>gatewayUsername</strong> (optional) - a String containing the user name to be used to authenticate the user using the
AUTH command. Default is not to issue the AUTH command.</p>
</li>
<li>
<p><strong>gatewayPassword</strong> (required if <strong>gatewayUsername</strong>) is set - a String representing the password to be used
to authenticate the user using the AUTH command.</p>
</li>
<li>
<p><strong>heloName</strong> (optional) - a String containing the name used in the SMTP HELO and EHLO commands. Default is the default domain,
which is typically <strong>localhost</strong>.</p>
</li>
<li>
<p><strong>mail.</strong>* (optional) - Any property beginning with <strong>mail.</strong> described in the Javadoc for package
&lt;a href="https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"&gt;*com.sun.mail.smtp*&lt;/a&gt;
can be set with a parameter of the corresponding name. For example the parameter
<strong>&lt;mail.smtp.ssl.enable&gt;true&lt;/mail.smtp.ssl.enable&gt;</strong> is equivalent to the Java code
<strong>props.put("mail.smtp.ssl.enable", "true");</strong>. Properties set by this facility override settings made
within the mailet code.&lt;br&gt;
Note: This facility should be used with extreme care by expert users with a thorough knowledge of the relevant RFCs and
the ability to perform their own problem resolutions.</p>
</li>
<li>
<p><strong>debug</strong> (optional) - a Boolean (true/false) indicating whether debugging is on. Default is false.</p>
</li>
</ul>
</div>
<div class="sect3">
<h4 id="_security"><a class="anchor" href="#_security"></a>Security</h4>
<div class="paragraph">
<p>You can use the <strong>mail.smtp.ssl.enable</strong> javax property described above to force SMTP outgoing delivery to default to SSL
encrypted traffic.</p>
</div>
<div class="paragraph">
<p>When enabling SSL, you might need to specify <strong>mail.smtp.ssl.checkserveridentity</strong> and <strong>mail.smtp.ssl.trust</strong>
properties. You can also control ciphersuites and protocols via <strong>mail.smtp.ssl.ciphersuites</strong> and
<strong>mail.smtp.ssl.protocols</strong> properties.</p>
</div>
<div class="paragraph">
<p><strong>startTls</strong> can alternatively be enabled upon sending a mail. For this, use the <strong>startTls</strong> configuration property, serving as a shortcut for
javax <strong>mail.smtp.starttls.enable</strong> property. Depending on how strict your security policy is, you might consider
<strong>mail.smtp.starttls.required</strong> as well. Be aware that configuring trust will then be required.</p>
</div>
<div class="paragraph">
<p>Read <a href="https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"><strong>com.sun.mail.smtp</strong></a>
for full information.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_removeallmailattributes"><a class="anchor" href="#_removeallmailattributes"></a>RemoveAllMailAttributes</h3>
<div class="paragraph">
<p>This mailet sets removes all attributes set on the Mail instance</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="RemoveAllMailAttributes"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_removemailattribute"><a class="anchor" href="#_removemailattribute"></a>RemoveMailAttribute</h3>
<div class="paragraph">
<p>This mailet sets attributes on the Mail.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="RemoveMailAttribute"&gt;
&lt;name&gt;attribute_name1&lt;/name&gt;
&lt;name&gt;attribute_name2&lt;/name&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_removemimeheader"><a class="anchor" href="#_removemimeheader"></a>RemoveMimeHeader</h3>
<div class="paragraph">
<p>Remove mime headers from the message (global) and per recipient (specific).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="RemoveMimeHeader"&gt;
&lt;name&gt;header1,header2&lt;/name&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_removemimeheader_2"><a class="anchor" href="#_removemimeheader_2"></a>RemoveMimeHeader</h3>
<div class="paragraph">
<p>This mailet removes all of the headers starting with a given prefix in the message (global) and per recipient (specific).</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="RemoveMimeHeaderByPrefix"&gt;
&lt;name&gt;X-APPLICATIVE-HEADER-&lt;/name&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_replacecontent"><a class="anchor" href="#_replacecontent"></a>ReplaceContent</h3>
<div class="paragraph">
<p>Replace text contents</p>
</div>
<div class="paragraph">
<p>This mailet allow to specific regular expression to replace text in subject and content.</p>
</div>
<div class="paragraph">
<p>Each expression is defined as: <strong>/REGEX_PATTERN/SUBSTITUTION_PATTERN/FLAGS/</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>REGEX_PATTERN</strong> is a regex used for the match</p>
</li>
<li>
<p><strong>SUBSTITUTION_PATTERN</strong> is a substitution pattern</p>
</li>
<li>
<p><strong>FLAGS</strong> flags supported for the pattern:</p>
<div class="ulist">
<ul>
<li>
<p>i: case insensitive</p>
</li>
<li>
<p>m: multi line</p>
</li>
<li>
<p>x: extended (N/A)</p>
</li>
<li>
<p>r: repeat - keep matching until a substitution is possible</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>To identify subject and body pattern we use the tags &lt;subjectPattern&gt; and &lt;bodyPattern&gt;</p>
</div>
<div class="paragraph">
<p>Rules can be specified in external files.
Lines must be CRLF terminated and lines starting with # are considered comments.
Tags used to include external files are &lt;subjectPatternFile&gt; and
&lt;bodyPatternFile&gt;
If file path starts with # then the file is loaded as a resource.</p>
</div>
<div class="paragraph">
<p>Use of both files and direct patterns at the same time is allowed.</p>
</div>
<div class="paragraph">
<p>This mailet allow also to enforce the resulting charset for messages processed, when a replacement has been done.
To do that the tag &lt;charset&gt; must be specified.</p>
</div>
<div class="paragraph">
<p>NOTE:
Regexp rules must be escaped by regexp escaping rules and applying this 2 additional rules:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>"/" char inside an expression must be prefixed with "\":
e.g: "/\//-//" replaces "/" with "-"</p>
</li>
<li>
<p>when the rules are specified using &lt;subjectPattern&gt; or &lt;bodyPattern&gt; and
"/,/" has to be used in a pattern string it must be prefixed with a "\".
E.g: "/\/\/,//" replaces "/" with "," (the rule would be "/\//,//" but the "/,/" must
be escaped.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_resend"><a class="anchor" href="#_resend"></a>Resend</h3>
<div class="paragraph">
<p>A mailet providing configurable redirection services.</p>
</div>
<div class="paragraph">
<p>Can produce listserver, forward and notify behaviour, with the original
message intact, attached, appended or left out altogether. Can be used as a
replacement to {@link Redirect}, having more consistent defaults, and new
options available.</p>
</div>
<div class="paragraph">
<p>Use &lt;code&gt;Resend&lt;/code&gt; if you need full control, &lt;code&gt;Redirect&lt;/code&gt; if
the more automatic behaviour of some parameters is appropriate.</p>
</div>
<div class="paragraph">
<p>This built in functionality is controlled by the configuration as laid out
below. In the table please note that the parameters controlling message
headers accept the &lt;b&gt;"unaltered"&lt;/b&gt; value, whose meaning is to
keep the associated header unchanged and, unless stated differently,
corresponds to the assumed default if the parameter is missing.</p>
</div>
<div class="paragraph">
<p>The configuration parameters are:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 2. Resend properties</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Property name</th>
<th class="tableblock halign-left valign-top">explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">recipients</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A comma delimited list of addresses for recipients of this message.</p>
<p class="tableblock">Such addresses can contain "full names", like <strong>Mr. John D. Smith
&lt;<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>&gt;</strong>.</p>
<p class="tableblock">The list can include constants "sender", "from",
"replyTo", "postmaster", "reversePath",
"recipients", "to", "null" and
"unaltered"; "replyTo" uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path; "from" is made
equivalent to "sender", and "to" is made equivalent to
"recipients"; "null" is ignored. Default:
"unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">to</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A comma delimited list of addresses to appear in the To: header.</p>
<p class="tableblock">Such addresses can contain "full names", like <strong>Mr. John D. Smith
&lt;<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>&gt;</strong>.</p>
<p class="tableblock">The list can include constants "sender", "from",
"replyTo", "postmaster", "reversePath",
"recipients", "to", "null" and
"unaltered"; "from" uses the From header if available,
otherwise the Sender header if available, otherwise the return-path;
"replyTo" uses the ReplyTo header if available, otherwise the From
header if available, otherwise the Sender header if available, otherwise the
return-path; "recipients" is made equivalent to "to"; if
"null" is specified alone it will remove this header. Default:
"unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">sender</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A single email address to appear in the From: header and become the sender.</p>
<p class="tableblock">It can include constants "sender", "postmaster" and
"unaltered"; "sender" is equivalent to
"unaltered".</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">message</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A text message to insert into the body of the email.</p>
<p class="tableblock">Default: no message is inserted.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">inline</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One of the following items:
&lt;/p&gt;
&lt;ul&gt;
* unaltered The original message is the new
message, for forwarding/aliasing
* heads The
headers of the original message are appended to the message
* body The
body of the original is appended to the new message
*
all &amp;nbsp
; Both headers and body are appended
* none
Neither body nor headers are appended</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">attachment</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One of the following items:</p>
<p class="tableblock">* heads The headers of the original are
attached as text
* body The body of the original is
attached as text
* all Both
headers and body are attached as a single text file
* none Nothing is attached
* message The original message is attached as type message/rfc822,
this means that it can, in many cases, be opened, resent, fw&#8217;d, replied to
etc by email client software.</p>
<p class="tableblock">Default: "none".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">passThrough</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true the original message continues in the mailet processor
after this mailet is finished. False causes the original to be stopped.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fakeDomainCheck</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true will check if the sender domain is valid.</p>
<p class="tableblock">Default: true.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">attachError</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true any error message available to the mailet is appended
to the message body (except in the case of inline == unaltered).</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">replyTo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A single email address to appear in the Reply-To: header.</p>
<p class="tableblock">It can include constants "sender", "postmaster"
"null" and "unaltered"; if "null" is specified
it will remove this header.</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">reversePath</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A single email address to appear in the Return-Path: header.</p>
<p class="tableblock">It can include constants "sender", "postmaster"
"null" and "unaltered"; if "null" is specified
then it will set it to &lt;&gt;, meaning "null return path".</p>
<p class="tableblock">Default: "unaltered".</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">subject</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">An optional string to use as the subject.</p>
<p class="tableblock">Default: keep the original message subject.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">prefix</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">An optional subject prefix prepended to the original message subject, or to a
new subject specified with the <strong>&lt;subject&gt;</strong> parameter.</p>
<p class="tableblock">For example: <strong>[Undeliverable mail]</strong>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">isReply</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false, if true the IN_REPLY_TO header will be set to the id of the
current message.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">debug</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true or false. If this is true it tells the mailet to write some debugging
information to the mailet log.</p>
<p class="tableblock">Default: false.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="RecipientIs=test@localhost" class="Resend"&gt;
&lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;
&lt;to&gt;list@localhost&lt;/to&gt;
&lt;sender&gt;owner@localhost&lt;/sender&gt;
&lt;message&gt;sent on from James&lt;/message&gt;
&lt;inline&gt;unaltered&lt;/inline&gt;
&lt;passThrough&gt;FALSE&lt;/passThrough&gt;
&lt;replyTo&gt;postmaster&lt;/replyTo&gt;
&lt;prefix xml:space="preserve"&gt;[test mailing] &lt;/prefix&gt;
&lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;
&lt;static&gt;TRUE&lt;/static&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>and:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="Resend"&gt;
&lt;recipients&gt;x@localhost&lt;/recipients&gt;
&lt;sender&gt;postmaster&lt;/sender&gt;
&lt;message xml:space="preserve"&gt;Message marked as spam:&lt;/message&gt;
&lt;inline&gt;heads&lt;/inline&gt;
&lt;attachment&gt;message&lt;/attachment&gt;
&lt;passThrough&gt;FALSE&lt;/passThrough&gt;
&lt;attachError&gt;TRUE&lt;/attachError&gt;
&lt;replyTo&gt;postmaster&lt;/replyTo&gt;
&lt;prefix&gt;[spam notification]&lt;/prefix&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="paragraph">
<p>The following example forwards the message without any modification, based on
the defaults:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="Resend&amp;quot/;&gt;</pre>
</div>
</div>
<div class="paragraph">
<p><strong>replyto</strong> can be used instead of <strong>replyTo</strong>; such name is kept for
backward compatibility.</p>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
as the message (or a copy of it) is reinjected in the spool
without any modification, the preceding example is very likely to cause a
"configuration loop" in your system, unless some other mailet has previously
modified something (a header for instance) that could force the resent
message follow a different path so that it does not return here
unchanged.
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="_setmailattribute"><a class="anchor" href="#_setmailattribute"></a>SetMailAttribute</h3>
<div class="paragraph">
<p>This mailet sets attributes on the Mail.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="SetMailAttribute"&gt;
&lt;name1&gt;value1&lt;/name1&gt;
&lt;name2&gt;value2&lt;/name2&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_setmailattribute_2"><a class="anchor" href="#_setmailattribute_2"></a>SetMailAttribute</h3>
<div class="paragraph">
<p>Adds a specified header and value to the message.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="AddHeader"&gt;
&lt;name&gt;X-MailetHeader&lt;/name&gt;
&lt;value&gt;TheHeaderValue&lt;/value&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_sieve"><a class="anchor" href="#_sieve"></a>Sieve</h3>
<div class="paragraph">
<p>Execute Sieve scripts for incoming emails, and set the result of the execution as attributes of the mail</p>
</div>
</div>
<div class="sect2">
<h3 id="_sign"><a class="anchor" href="#_sign"></a>Sign</h3>
<div class="paragraph">
<p>Puts a <strong>server-side</strong> SMIME signature on a message.</p>
</div>
<div class="paragraph">
<p>It is a concrete subclass of Sign, with very few modifications to it,
to specialize for SMIME.</p>
</div>
<div class="paragraph">
<p>Handles the following init parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>&lt;keyHolderClass&gt;: Sets the class of the KeyHolder object that will handle the cryptography functions,
for example org.apache.james.security.SMIMEKeyHolder for SMIME.</p>
</li>
<li>
<p>&lt;debug&gt;: if <strong>true</strong> some useful information is logged.
The default is <strong>false</strong>.</p>
</li>
<li>
<p>&lt;keyStoreFileName&gt;: the {@link java.security.KeyStore} full file name.</p>
</li>
<li>
<p>&lt;keyStorePassword&gt;: the <strong>KeyStore</strong> password.
If given, it is used to check the integrity of the keystore data,
otherwise, if null, the integrity of the keystore is not checked.</p>
</li>
<li>
<p>&lt;keyAlias&gt;: the alias name to use to search the Key using {@link java.security.KeyStore#getKey}.
The default is to look for the first and only alias in the keystore;
if zero or more than one is found a {@link java.security.KeyStoreException} is thrown.</p>
</li>
<li>
<p>&lt;keyAliasPassword&gt;: the alias password. The default is to use the <strong>KeyStore</strong> password.
At least one of the passwords must be provided.</p>
</li>
<li>
<p>&lt;keyStoreType&gt;: the type of the keystore. The default will use {@link java.security.KeyStore#getDefaultType}.</p>
</li>
<li>
<p>&lt;postmasterSigns&gt;: if <strong>true</strong> the message will be signed even if the sender is the Postmaster. The default is <strong>true</strong>.</p>
</li>
<li>
<p>&lt;rebuildFrom&gt;: If <strong>true</strong> will modify the "From:" header. The default is <strong>true</strong>.</p>
</li>
<li>
<p>&lt;signerName&gt;: the name of the signer to be shown in the explanation text. The default is to use the "CN="
property of the signing certificate.</p>
</li>
<li>
<p>&lt;explanationText&gt;. There is a default explanation string template in English, displaying
also all the headers of the original message.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_smimechecksignature"><a class="anchor" href="#_smimechecksignature"></a>SMIMECheckSignature</h3>
<div class="paragraph">
<p>Verifies the s/mime signature of a message. The s/mime signing ensure that
the private key owner is the real sender of the message. To be checked by
this mailet the s/mime signature must contain the actual signature, the
signer&#8217;s certificate and optionally a set of certificate that can be used to
create a chain of trust that starts from the signer&#8217;s certificate and leads
to a known trusted certificate.</p>
</div>
<div class="paragraph">
<p>This check is composed by two steps: firstly it&#8217;s ensured that the signature
is valid, then it&#8217;s checked if a chain of trust starting from the signer
certificate and that leads to a trusted certificate can be created. The first
check verifies that the the message has not been modified after the signature
was put and that the signer&#8217;s certificate was valid at the time of the
signing. The latter should ensure that the signer is who he declare to be.</p>
</div>
<div class="paragraph">
<p>The results of the checks perfomed by this mailet are wrote as a mail
attribute which default name is org.apache.james.SMIMECheckSignature (it can
be changed using the mailet parameter <strong>mailAttribute</strong>). After
the check this attribute will contain a list of SMIMESignerInfo object, one
for each message&#8217;s signer. These objects contain the signer&#8217;s certificate and
the trust path.</p>
</div>
<div class="paragraph">
<p>Optionally, specifying the parameter <strong>strip</strong>, the signature of
the message can be stripped after the check. The message will become a
standard message without an attached s/mime signature.</p>
</div>
<div class="paragraph">
<p>The configuration parameter of this mailet are summerized below. The firsts
defines the location, the format and the password of the keystore containing
the certificates that are considered trusted. Note: only the trusted certificate
entries are read, the key ones are not.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>keyStoreType (default: jks): Certificate store format . "jks" is the
standard java certificate store format, but pkcs12 is also quite common and
compatible with standard email clients like Outlook Express and Thunderbird.</p>
</li>
<li>
<p>keyStoreFileName (default: JAVA_HOME/jre/lib/security/cacert): Certificate
store path.</p>
</li>
<li>
<p>keyStorePassword (default: ""): Certificate store password.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Other parameters configure the behavior of the mailet:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>strip (default: false): Defines if the s/mime signature of the message
have to be stripped after the check or not. Possible values are true and
false.</p>
</li>
<li>
<p>mailAttribute (default: org.apache.james.SMIMECheckSignature):
specifies in which attribute the check results will be written.</p>
</li>
<li>
<p>onlyTrusted (default: true): Usually a message signature to be
considered by this mailet as authentic must be valid and trusted. Setting
this mailet parameter to "false" the last condition is relaxed and also
"untrusted" signature are considered will be considered as authentic.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_smimedecrypt"><a class="anchor" href="#_smimedecrypt"></a>SMIMEDecrypt</h3>
<div class="paragraph">
<p>This mailet decrypts a s/mime encrypted message. It takes as input an
encrypted message and it tries to dechiper it using the key specified in its
configuration. If the decryption is successful the mail will be changed and
it will contain the decrypted message. The mail attribute
<strong>org.apache.james.SMIMEDecrypt</strong> will contain the public
certificate of the key used in the process.</p>
</div>
<div class="paragraph">
<p>The configuration parameters of this mailet are summarized below. The firsts
define the keystore where the key that will be used to decrypt messages is
saved.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>keyStoreType (default: system dependent): defines the type of the store.
Usually jks, pkcs12 or pkcs7</p>
</li>
<li>
<p>keyStoreFileName (mandatory): private key store path.</p>
</li>
<li>
<p>keyStorePassword (default: ""): private key store password</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The other parameters define which private key have to be used. (if the store
contains more than one key).</p>
</div>
<div class="ulist">
<ul>
<li>
<p>keyAlias: private key alias.</p>
</li>
<li>
<p>keyPass: private key password</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_smimesign"><a class="anchor" href="#_smimesign"></a>SMIMESign</h3>
<div class="paragraph">
<p>Puts a <strong>server-side</strong> signature on a message.</p>
</div>
<div class="paragraph">
<p>It is a concrete subclass of AbstractSign, with very few modifications to it.</p>
</div>
<div class="paragraph">
<p>A text file with an explanation text is attached to the original message,
and the resulting message with all its attachments is signed.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The resulting appearance of the message is almost unchanged: only an extra attachment</p>
</li>
<li>
<p>and the signature are added.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The kind of signature depends on the value of the &lt;keyHolderClass&gt; init parameter.</p>
</div>
<div class="paragraph">
<p>Handles the following init parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>&lt;keyHolderClass&gt;: Sets the class of the KeyHolder object that will handle the cryptography functions,
for example org.apache.james.security.SMIMEKeyHolder for SMIME.</p>
</li>
<li>
<p>&lt;debug&gt;: if <strong>true</strong> some useful information is logged.
The default is <strong>false</strong>.</p>
</li>
<li>
<p>&lt;keyStoreFileName&gt;: the {@link java.security.KeyStore} full file name.</p>
</li>
<li>
<p>&lt;keyStorePassword&gt;: the <strong>KeyStore</strong> password.
If given, it is used to check the integrity of the keystore data,
otherwise, if null, the integrity of the keystore is not checked.</p>
</li>
<li>
<p>&lt;keyAlias&gt;: the alias name to use to search the Key using {@link java.security.KeyStore#getKey}.
The default is to look for the first and only alias in the keystore;
if zero or more than one is found a {@link java.security.KeyStoreException} is thrown.</p>
</li>
<li>
<p>&lt;keyAliasPassword&gt;: the alias password. The default is to use the <strong>KeyStore</strong> password.
At least one of the passwords must be provided.</p>
</li>
<li>
<p>&lt;keyStoreType&gt;: the type of the keystore. The default will use {@link java.security.KeyStore#getDefaultType}.</p>
</li>
<li>
<p>&lt;postmasterSigns&gt;: if <strong>true</strong> the message will be signed even if the sender is the Postmaster. The default is <strong>true</strong>.</p>
</li>
<li>
<p>&lt;rebuildFrom&gt;: If <strong>true</strong> will modify the "From:" header. The default is <strong>true</strong>.</p>
</li>
<li>
<p>&lt;signerName&gt;: the name of the signer to be shown in the explanation text. The default is to use the "CN="
property of the signing certificate.</p>
</li>
<li>
<p>&lt;explanationText&gt;. There is a default explanation string template in English, displaying
also all the headers of the original message.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_spamassassin"><a class="anchor" href="#_spamassassin"></a>SpamAssassin</h3>
<div class="paragraph">
<p>Sends the message through daemonized SpamAssassin (spamd), visit
<a href="http://spamassassin.apache.org">spamassassin.apache.org</a> for info
on configuration. The header X-Spam-Status is added to every message, this
contains the score and the threshold score for spam (usually 5.0). If the
message exceeds the threshold, the header X-Spam-Flag will be added with the
value of YES. The default host for spamd is localhost and the default port is
783.</p>
</div>
<div class="literalblock">
<div class="content">
<pre> org.apache.james.spamassassin.status - Holds the status
org.apache.james.spamassassin.flag - Holds the flag</pre>
</div>
</div>
<div class="paragraph">
<p>Sample Configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet notmatch="SenderHostIsLocal" class="SpamAssassin"&gt;
&lt;spamdHost&gt;localhost&lt;/spamdHost&gt;
&lt;spamdPort&gt;783&lt;/spamdPort&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_stripattachment"><a class="anchor" href="#_stripattachment"></a>StripAttachment</h3>
<div class="paragraph">
<p>Remove attachments from a Message. Supports simple removal, storing to file,
or storing to mail attributes.</p>
</div>
<div class="paragraph">
<p>Configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match=&amp;quot;All&amp;quot; class=&amp;quot;StripAttachment&amp;quot; &gt;
&lt;pattern &gt;.*\.xls &lt;/pattern&gt; &lt;!-- The regular expression that must be matched -- &gt;
&lt;!-- notpattern &gt;.*\.xls &lt;/notpattern--&gt; &lt;!-- The regular expression that must be matched -- &gt;
&lt;mimeType&gt;text/calendar&lt;/mimeType&gt; &lt;!-- The matching mimeType -- &gt;
&lt;directory &gt;c:\temp\james_attach &lt;/directory&gt; &lt;!-- The directory to save to -- &gt;
&lt;remove &gt;all &lt;/remove&gt; &lt;!-- either &amp;quot;no&amp;quot;, &amp;quot;matched&amp;quot;, &amp;quot;all&amp;quot; -- &gt;
&lt;!-- attribute&gt;my.attribute.name&lt;/attribute --&gt;
&lt;/mailet &gt;</pre>
</div>
</div>
<div class="paragraph">
<p>At least one of pattern, notpattern and mimeType is required.</p>
</div>
</div>
<div class="sect2">
<h3 id="_textcalendarbodytoattachment"><a class="anchor" href="#_textcalendarbodytoattachment"></a>TextCalendarBodyToAttachment</h3>
<div class="paragraph">
<p>This mailet converts Content-Type of MimeMessage from text/calendar to mulitpart/mixed</p>
</div>
<div class="paragraph">
<p>The BodyPart should be retrieved from content of text/calendar with all the same "Content-*" headers from original message
and those "Content-" header are removed from original message</p>
</div>
<div class="paragraph">
<p>It does not takes any parameter</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="TextCalendarBodyToAttachment"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_toprocessor"><a class="anchor" href="#_toprocessor"></a>ToProcessor</h3>
<div class="paragraph">
<p>This mailet redirects the mail to the named processor</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="ToProcessor"&gt;
&lt;processor&gt;spam&lt;/processor&gt;
&lt;notice&gt;Notice attached to the message (optional)&lt;/notice&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_torepository"><a class="anchor" href="#_torepository"></a>ToRepository</h3>
<div class="paragraph">
<p>Stores incoming Mail in the specified Repository.</p>
</div>
<div class="paragraph">
<p>If the "passThrough" in conf is true the mail will be returned untouched in
the pipe and may be processed by additional mailets. If false will be destroyed.</p>
</div>
</div>
<div class="sect2">
<h3 id="_tosenderdomainrepository"><a class="anchor" href="#_tosenderdomainrepository"></a>ToSenderDomainRepository</h3>
<div class="paragraph">
<p>Stores incoming Mail in a repository defined by the sender&#8217;s domain.&lt;br&gt;</p>
</div>
<div class="paragraph">
<p>Supported configuration parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>"urlPrefix" mandatory: defines the prefix for the per sender&#8217;s domain repository. For example for the value
'cassandra://var/mail/sendersRepositories/', a mail sent by '<a href="mailto:user@james.org">user@james.org</a>' will be stored
in 'cassandra://var/mail/sendersRepositories/james.org'.</p>
</li>
<li>
<p>"passThrough" optional, defaults to false. If true, the processing of the mail continues. If false it stops.</p>
</li>
<li>
<p>"allowRepositoryCreation" optional, defaults to true. If true, non existing repository will be created. In case of
misconfiguration, this might lead to arbitrary repository creation. If false, the incoming mails will be stored only
in already existing repository. If not existing, the email will be dropped with an appropriate log warning (leading
to potential data loss). In case, you want to create a repository manually, make a http PUT request to
/mailRepositories/encodedUrlOfTheRepository from web admin api.
For example <a href="http://ip:port/mailRepositories/file%3A%2F%2FmailRepo" class="bare">http://ip:port/mailRepositories/file%3A%2F%2FmailRepo</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="ToSenderDomainRepository"&gt;
&lt;urlPrefix&gt;cassandra://var/mail/sendersRepositories/&lt;/urlPrefix&gt;
&lt;passThrough&gt;false&lt;/passThrough&gt;
&lt;allowRepositoryCreation&gt;true&lt;/allowRepositoryCreation&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_vacationmailet"><a class="anchor" href="#_vacationmailet"></a>VacationMailet</h3>
<div class="paragraph">
<p>This mailet uses <a href="https://jmap.io/spec-mail.html#vacation-response">JMAP VacationResponse</a> and
sends back a vacation notice to the sender if needed.</p>
</div>
</div>
<div class="sect2">
<h3 id="_withpriority"><a class="anchor" href="#_withpriority"></a>WithPriority</h3>
<div class="paragraph">
<p>This mailet sets the priority of the incoming mail.</p>
</div>
<div class="paragraph">
<p>Example configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="WithPriority"&gt;
&lt;priority&gt;7&lt;/priority&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_withstoragedirective"><a class="anchor" href="#_withstoragedirective"></a>WithStorageDirective</h3>
<div class="paragraph">
<p>WithStorageDirective position storage directive for the recipients of this email.</p>
</div>
<div class="paragraph">
<p>These directives are used by &lt;strong&gt;LocalDelivery&lt;/strong&gt; mailet when adding the email to the recipients mailboxes.</p>
</div>
<div class="paragraph">
<p>The following storage directives can be set:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>targetFolderName: the folder to append the email in. (compulsory)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="IsMarkedAsSpam" class="WithStorageDirective"&gt;
&lt;targetFolderName&gt;Spam&lt;/targetFolderName&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_experimental_mailets"><a class="anchor" href="#_experimental_mailets"></a>Experimental mailets</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_addhabeaswarrantmark"><a class="anchor" href="#_addhabeaswarrantmark"></a>AddHabeasWarrantMark</h3>
<div class="paragraph">
<p>This matcher adds the Hebeas Warrant Mark to a message.</p>
</div>
<div class="paragraph">
<p>For details see: <a href="http://www.hebeas.com&lt;/p&gt" class="bare">http://www.hebeas.com&lt;/p&gt</a>;</p>
</div>
<div class="paragraph">
<p>Usage:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="AddHabeasWarrantMark" /&gt;;</pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Although this mailet is covered by the Apache Software License,
the Habeas Warrant Mark is copyright. A separate license from Habeas
is required in order to legally attach the Habeas Warrant Mark to
e-mail messages. Each James Administrator is responsible for
ensuring that James is configured to attach the Habeas Warrant Mark
only to e-mail covered by a suitable license received from Habeas.
</td>
</tr>
</table>
</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; FURTHERMORE, if James is to be capable of sending Habeas SWE, I need
&gt; to write a Mailet that attaches the headers. As with any MTA, it
&gt; would be up to the administrator to properly configure James and make
&gt; sure that licenses are acquired. Since the Habeas Warrant Mark is
&gt; copyright, I believe that I require authorization from you for that
&gt; Mailet, especially since it attaches the Habeas Warrant Mark. For my
&gt; own protection, please show me why such authorization is unnecessary,
&gt; send me a digitally signed e-mail, or FAX a signed authorization
*
You do not yourself need the authorization to build the functionality
into the [mailet]; what one needs authorization, in the form of a
license, for, is to use the mark *in headers*, in outgoing email.
However, please let me know if you would like something more
formal, and I can try to have something faxed to you.
*
&gt; The Mailet docs would reference the Habeas website, and inform
&gt; administrators that in order to USE the mailet, they need to ensure
&gt; that they have whatever licenses are required from you as appropriate
&gt; to your licensing terms.
*
That's absolutely perfect!
-----------------------------------</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_clamavscan"><a class="anchor" href="#_clamavscan"></a>ClamAVScan</h3>
<div class="paragraph">
<p>Does an antivirus scan check using a ClamAV daemon (CLAMD)</p>
</div>
<div class="paragraph">
<p>Interacts directly with the daemon using the "stream" method,
which should have the lowest possible overhead.</p>
</div>
<div class="paragraph">
<p>The CLAMD daemon will typically reside on <strong>localhost</strong>, but could reside on a
different host.
It may also consist on a set of multiple daemons, each residing on a different
server and on different IP number.
In such case a DNS host name with multiple IP addresses (round-robin load sharing)
is supported by the mailet (but on the same port number).</p>
</div>
<div class="paragraph">
<p>Handles the following init parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>&lt;debug&gt;</strong></p>
</li>
<li>
<p><strong>&lt;host&gt;</strong>: the host name of the server where CLAMD runs. It can either be
a machine name, such as
"<strong>java.sun.com</strong>", or a textual representation of its
IP address. If a literal IP address is supplied, only the
validity of the address format is checked.
If the machine name resolves to multiple IP addresses, <strong>round-robin load sharing</strong> will
be used.
The default is <strong>localhost</strong>.</p>
</li>
<li>
<p><strong>&lt;port&gt;</strong>: the port on which CLAMD listens. The default is <strong>3310</strong>.</p>
</li>
<li>
<p><strong>&lt;maxPings&gt;</strong>: the maximum number of connection retries during startup.
If the value is <strong>0</strong> no startup test will be done.
The default is <strong>6</strong>.</p>
</li>
<li>
<p><strong>&lt;pingIntervalMilli&gt;</strong>: the interval (in milliseconds)
between each connection retry during startup.
The default is <strong>30000</strong> (30 seconds).</p>
</li>
<li>
<p><strong>&lt;streamBufferSize&gt;</strong>: the BufferedOutputStream buffer size to use
writing to the <strong>stream connection</strong>. The default is <strong>8192</strong>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The actions performed are as follows:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>During initialization:</p>
</li>
<li>
<p>Gets all <strong>config.xml</strong> parameters, handling the defaults;</p>
</li>
<li>
<p>resolves the <strong>&lt;host&gt;</strong> parameter, creating the round-robin IP list;</p>
</li>
<li>
<p>connects to CLAMD at the first IP in the round-robin list, on
the specified <strong>&lt;port&gt;</strong>;</p>
</li>
<li>
<p>if unsuccessful, retries every <strong>&lt;pingIntervalMilli&gt;</strong> milliseconds up to
<strong>&lt;maxPings&gt;</strong> times;</p>
</li>
<li>
<p>sends a <strong>PING</strong> request;</p>
</li>
<li>
<p>waits for a <strong>PONG</strong> answer;</p>
</li>
<li>
<p>repeats steps 3-6 for every other IP resolved.</p>
</li>
<li>
<p>For every mail</p>
</li>
<li>
<p>connects to CLAMD at the "next" IP in the round-robin list, on
the specified <strong>&lt;port&gt;</strong>, and increments the "next" index;
if the connection request is not accepted tries with the next one
in the list unless all of them have failed;</p>
</li>
<li>
<p>sends a "<strong>STREAM</strong>" request;</p>
</li>
<li>
<p>parses the "<strong>PORT *streamPort</strong>*" answer obtaining the port number;</p>
</li>
<li>
<p>makes a second connection (the <strong>stream connection</strong>) to CLAMD at the same host (or IP)
on the <strong>streamPort</strong> just obtained;</p>
</li>
<li>
<p>sends the mime message to CLAMD (using {@link MimeMessage#writeTo(java.io.OutputStream)})
through the <strong>stream connection</strong>;</p>
</li>
<li>
<p>closes the <strong>stream connection</strong>;</p>
</li>
<li>
<p>gets the "<strong>OK</strong>" or "<strong>&#8230;&#8203; FOUND</strong>" answer from the main connection;</p>
</li>
<li>
<p>closes the main connection;</p>
</li>
<li>
<p>sets the "<strong>org.apache.james.infected</strong>" <strong>mail attribute</strong> to either
"<strong>true</strong>" or "<strong>false</strong>";</p>
</li>
<li>
<p>adds the "<strong>X-MessageIsInfected</strong>" <strong>header</strong> to either
"<strong>true</strong>" or "<strong>false</strong>";</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Some notes regarding <a href="http://www.clamav.net/">clamav.conf</a> :</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>LocalSocket</strong> must be commented out</p>
</li>
<li>
<p><strong>TCPSocket</strong> must be set to a port# (typically 3310)</p>
</li>
<li>
<p><strong>StreamMaxLength</strong> must be &gt;= the James config.xml parameter
&lt;*maxmessagesize*&gt; in SMTP &lt;*handler*&gt;</p>
</li>
<li>
<p><strong>MaxThreads</strong> should? be &gt;= the James config.xml parameter
&lt;*threads*&gt; in &lt;*spoolmanager*&gt;</p>
</li>
<li>
<p><strong>ScanMail</strong> must be uncommented</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Here follows an example of config.xml definitions deploying CLAMD on localhost,
and handling the infected messages:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;!-- Do an antivirus scan --&gt;
&lt;mailet match="All" class="ClamAVScan" onMailetException="ignore"/&gt;
&lt;!-- If infected go to virus processor --&gt;
&lt;mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor"&gt;
&lt;processor&gt; virus &lt;/processor&gt;
&lt;/mailet&gt;
&lt;!-- Check attachment extensions for possible viruses --&gt;
&lt;mailet match="AttachmentFileNameIs=-d -z *.exe *.com *.bat *.cmd *.pif *.scr *.vbs *.avi *.mp3 *.mpeg *.shs" class="ToProcessor"&gt;
&lt;processor&gt; bad-extensions &lt;/processor&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;!-- Messages containing viruses --&gt;
&lt;processor name="virus"&gt;
&lt;!-- To avoid a loop while bouncing --&gt;
&lt;mailet match="All" class="SetMailAttribute"&gt;
&lt;org.apache.james.infected&gt;true, bouncing&lt;/org.apache.james.infected&gt;
&lt;/mailet&gt;
&lt;mailet match="SMTPAuthSuccessful" class="Bounce"&gt;
&lt;sender&gt;bounce-admin@xxx.com&lt;/sender&gt;
&lt;inline&gt;heads&lt;/inline&gt;
&lt;attachment&gt;none&lt;/attachment&gt;
&lt;notice&gt; Warning: We were unable to deliver the message below because it was found infected by virus(es). &lt;/notice&gt;
&lt;/mailet&gt;
&lt;mailet match="All" class="ToRepository"&gt;
&lt;repositoryPath&gt;file://var/mail/infected/&lt;/repositoryPath&gt;
&lt;/mailet&gt;
&lt;mailet match="All" class="Null" /&gt;
&lt;/processor&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_classifybounce"><a class="anchor" href="#_classifybounce"></a>ClassifyBounce</h3>
<div class="paragraph">
<p>Assesses the message to determine if it was a hard or soft bounce, and if it was a soft bounce, something of its nature..</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="ClassifyBounce"&gt;
&lt;headerName&gt;X-MailetHeader&lt;/headerName&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_fromrepository"><a class="anchor" href="#_fromrepository"></a>FromRepository</h3>
<div class="paragraph">
<p>Re-spools Mail found in the specified Repository.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIs=respool@localhost" class="FromRepository"&gt;
&lt;repositoryPath&gt; *repository path* &lt;/repositoryPath&gt;
&lt;processor&gt; *target processor* &lt;/repositoryPath&gt;
&lt;delete&amp;t; [true|&lt;b&gt;false&lt;/b&gt;] &lt;/delete&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_headerstohttp"><a class="anchor" href="#_headerstohttp"></a>HeadersToHTTP</h3>
<div class="paragraph">
<p>Serialise the email and pass it to an HTTP call</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="HeadersToHTTP"&gt;
&lt;url&gt;http://192.168.0.252:3000/alarm&lt;/url&gt;
&lt;parameterKey&gt;Test&lt;/parameterKey&gt;
&lt;parameterValue&gt;ParameterValue&lt;/parameterValue&gt;
&lt;passThrough&gt;true&lt;/passThrough&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_onlytext"><a class="anchor" href="#_onlytext"></a>OnlyText</h3>
<div class="paragraph">
<p>Keep only the text part of a message.</p>
</div>
<div class="paragraph">
<p>If the message is text only then it doesn&#8217;t touch it, if it is a multipart it
transform it a in plain text message with the first text part found.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>text/plain</p>
</li>
<li>
<p>text/html &#8658; with a conversion to text only</p>
</li>
<li>
<p>text/* as is.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_recoverattachment"><a class="anchor" href="#_recoverattachment"></a>RecoverAttachment</h3>
<div class="paragraph">
<p>This mailet takes an attachment stored in an attribute and attach it back to
the message</p>
</div>
<div class="paragraph">
<p>This may be used to place back attachment stripped by StripAttachment and
stored in the attribute
<strong>org.apache.james.mailet.standard.mailets.StripAttachment.saved</strong></p>
</div>
<div class="literalblock">
<div class="content">
<pre> &lt;mailet match="All" class="RecoverAttachment" &gt;
&lt;attribute&gt;my.attribute.name&lt;/attribute&gt;
&lt;/mailet &gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_serialisetohttp"><a class="anchor" href="#_serialisetohttp"></a>SerialiseToHTTP</h3>
<div class="paragraph">
<p>Serialise the email and pass it to an HTTP call</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="SerialiseToHTTP"&gt;
&lt;name&gt;URL&lt;/name&gt; &lt;value&gt;url where serialised message will be posted&lt;/value&gt;
&lt;name&gt;ParameterKey&lt;/name&gt; &lt;value&gt;An arbitrary parameter be added to the post&lt;/value&gt;
&lt;name&gt;ParameterValue&lt;/name&gt; &lt;value&gt;A value for the arbitrary parameter&lt;/value&gt;
&lt;name&gt;MessageKeyName&lt;/name&gt; &lt;value&gt;Field name for the serialised message&lt;/value&gt;
&lt;name&gt;passThrough&lt;/name&gt; &lt;value&gt;true or false&lt;/value&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_servertime"><a class="anchor" href="#_servertime"></a>ServerTime</h3>
<div class="paragraph">
<p>Returns the current time for the mail server.</p>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIs=time@cadenza.lokitech.com" class="ServerTime"/&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_spf"><a class="anchor" href="#_spf"></a>SPF</h3>
<div class="paragraph">
<p>Check the ip, sender, helo against SPF. Add the following attributes to the
mail object:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> org.apache.james.transport.mailets.spf.explanation
org.apache.james.transport.mailets.spf.result</pre>
</div>
</div>
<div class="paragraph">
<p>Sample configuration:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="All" class="SPF"&gt;
&lt;addHeader&gt;true&lt;/addHeader&gt;
&lt;debug&gt;false&lt;/debug&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_tosenderfolder"><a class="anchor" href="#_tosenderfolder"></a>ToSenderFolder</h3>
<div class="literalblock">
<div class="content">
<pre>Receives a Mail from the Queue and takes care to deliver the message
to a defined folder of the sender.</pre>
</div>
</div>
<div class="paragraph">
<p>You have to define the folder name of the sender.</p>
</div>
<div class="paragraph">
<p>The flag 'consume' will tell is the mail will be further</p>
</div>
<div class="paragraph">
<p>processed by the upcoming processor mailets, or not.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIsLocal" class="ToSenderFolder"&gt;
&lt;folder&gt; *Sent Items* &lt;/folder&gt;
&lt;consume&gt; *false* &lt;/consume&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_unwraptext"><a class="anchor" href="#_unwraptext"></a>UnwrapText</h3>
<div class="paragraph">
<p>Remove (best effort to) the hardcoded wrapping from a message.</p>
</div>
<div class="paragraph">
<p>If the text is "format=flowed" then deflows the text. Otherwise it forces a dewrap of the text.</p>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>quotewidth - when we try to dewrap e quoted text it helps knowing the original
with, so we can reconstruct "wrapped wraps" created by multiple wrappings by clients with
different original width or simply to the add of the heading "&gt;" that increase the line
length.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The value should be "WIDTH+X" if the original length is known, "-X" otherwise.</p>
</div>
<div class="paragraph">
<p>In the latter case the length of the longer line will be used.</p>
</div>
<div class="paragraph">
<p>X is the tollerance needed for the quoting chars: if the original width is known the suggested
value for X is 2 (because of "&gt; " prefix), otherwise it is suggested to increase it to a value
like 10 (-10)</p>
</div>
<div class="paragraph">
<p>In summary, if the original wrap is known (for example 76, for flowed messages) <strong>quotewidth = 78</strong></p>
</div>
<div class="paragraph">
<p>Otherwise <strong>quotewidth = -10</strong></p>
</div>
</div>
<div class="sect2">
<h3 id="_useheaderrecipients"><a class="anchor" href="#_useheaderrecipients"></a>UseHeaderRecipients</h3>
<div class="paragraph">
<p>Mailet designed to process the recipients from the mail headers rather
than the recipients specified in the SMTP message header. This can be
useful if your mail is redirected on-route by a mail server that
substitutes a fixed recipient address for the original.</p>
</div>
<div class="paragraph">
<p>To use this, match against the redirection address using the
<strong>RecipientIs</strong> matcher and set the mailet 'class' to
<strong>UseHeaderRecipients</strong>. This will cause the email to be
re-injected into the root process with the recipient substituted
by all the recipients in the Mail-For, To and Cc headers
of the message.</p>
</div>
<div class="paragraph">
<p>e.g.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>&lt;mailet match="RecipientIs=forwarded@myhost" class="UseHeaderRecipients"&gt;
&lt;/mailet&gt;</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_wraptext"><a class="anchor" href="#_wraptext"></a>WrapText</h3>
<div class="paragraph">
<p>Convert a message to format=flowed</p>
</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>