| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <title>Distributed James Server — 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-distributed-app" data-version="3.8.1"> |
| <aside class="nav"> |
| <div class="panels"> |
| <div class="nav-panel-menu is-active" data-panel="menu"> |
| <nav class="nav-menu"> |
| <button class="nav-menu-toggle" aria-label="Toggle expand/collapse all" style="display: none"></button> |
| <h3 class="title"><a href="../index.html">Apache James Distributed Server</a></h3> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="0"> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../index.html">Distributed James Application</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../objectives.html">Objectives and motivation</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../architecture/index.html">Architecture</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../architecture/implemented-standards.html">Implemented standards</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../architecture/consistency-model.html">Consistency Model</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../architecture/specialized-instances.html">Specialized instances</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../run/index.html">Run</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../run/run-java.html">Run with Java</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../run/run-docker.html">Run with Docker</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../run/run-kubernetes.html">Run with Kubernetes</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../run/k8s-checklist.html">Deployment Checklist</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../run/k8s-logsMetrics.html">Logs & Metrics</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../run/k8s-values.html">values.yaml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../run/k8s-secrets.html">secrets.yaml</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="index.html">Configuration</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Protocols</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="imap.html">imapserver.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="jmap.html">jmap.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="jmx.html">jmx.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="smtp.html">smtpserver.xml & lmtpserver.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="smtp-hooks.html">Packaged SMTP hooks</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="pop3.html">pop3server.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="webadmin.html">webadmin.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="ssl.html">SSL & TLS</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="sieve.html">Sieve & ManageSieve</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Storage dependencies</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="blobstore.html">blobstore.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="cassandra.html">cassandra.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="opensearch.html">opensearch.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="rabbitmq.html">rabbitmq.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="redis.html">redis.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="tika.html">tika.properties</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Core components</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="batchsizes.html">batchsizes.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="dns.html">dnsservice.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="domainlist.html">domainlist.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="healthcheck.html">healthcheck.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="mailetcontainer.html">mailetcontainer.xml</a> |
| </li> |
| <li class="nav-item is-current-page" data-depth="4"> |
| <a class="nav-link" href="mailets.html">Packaged Mailets</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="matchers.html">Packaged Matchers</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="mailrepositorystore.html">mailrepositorystore.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="recipientrewritetable.html">recipientrewritetable.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="search.html">search.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="usersrepository.html">usersrepository.xml</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Extensions</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="vault.html">deletedMessageVault.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="extensions.html">extensions.properties</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="listeners.html">listeners.xml</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="spam.html">Anti-Spam setup</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="remote-delivery-error-handling.html">About RemoteDelivery error handling</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="collecting-contacts.html">Contact collection</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="collecting-events.html">Event collection</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="dsn.html">ESMTP DSN support</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../operate/index.html">Operate</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/guide.html">Operator guide</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/performanceChecklist.html">Performance checklist</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/logging.html">Logging</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/webadmin.html">WebAdmin REST administration API</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/metrics.html">Metrics</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/migrating.html">Migrating existing data</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/cli.html">Command Line Interface</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/cassandra-migration.html">Cassandra migration</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../operate/security.html">Security checklist</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../extending/index.html">Extending server behavior</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending/mail-processing.html">Custom mail processing components</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending/mailbox-listeners.html">Custom Mailbox Listeners</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending/smtp-hooks.html">Custom SMTP hooks</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending/webadmin-routes.html">Custom WebAdmin routes</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending/imap.html">Custom IMAP processing</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../benchmark/index.html">Performance benchmark</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../benchmark/db-benchmark.html">Database benchmarks</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../benchmark/james-benchmark.html">James benchmarks</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </nav> |
| </div> |
| <div class="nav-panel-explore" data-panel="explore"> |
| <div class="context"> |
| <span class="title">Apache James Distributed Server</span> |
| <span class="version">3.8.1 SNAPSHOT</span> |
| </div> |
| <ul class="components"> |
| <li class="component is-current"> |
| <div class="title"><a href="../index.html">Apache James Distributed Server</a></div> |
| <ul class="versions"> |
| <li class="version is-current is-latest"> |
| <a href="../index.html">3.8.1 SNAPSHOT</a> |
| </li> |
| </ul> |
| </li> |
| <li class="component"> |
| <div class="title"><a href="../../../james-project/3.8.1/index.html">Apache James Server</a></div> |
| <ul class="versions"> |
| <li class="version is-latest"> |
| <a href="../../../james-project/3.8.1/index.html">3.8.1 SNAPSHOT</a> |
| </li> |
| <li class="version"> |
| <a href="../../../james-project/3.6.0/index.html">3.6.0 Snapshot</a> |
| </li> |
| </ul> |
| </li> |
| <li class="component"> |
| <div class="title"><a href="../../../james-site/latest/index.html">Apache James Site</a></div> |
| <ul class="versions"> |
| <li class="version is-latest"> |
| <a href="../../../james-site/latest/index.html">latest</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </aside> |
| </div> |
| <main class="article"> |
| <div class="toolbar" role="navigation"> |
| <button class="nav-toggle"></button> |
| <a href="../../../james-site/latest/homepage.html" class="home-link"></a> |
| <nav class="breadcrumbs" aria-label="breadcrumbs"> |
| <ul> |
| <li><a href="../index.html">Apache James Distributed Server</a></li> |
| <li><a href="../index.html">Distributed James Application</a></li> |
| <li><a href="index.html">Configuration</a></li> |
| <li>Core components</li> |
| <li><a href="mailets.html">Packaged Mailets</a></li> |
| </ul> |
| </nav> |
| <div class="edit-this-page"><a href="https://github.com/apache/james-project/blob/master/server/apps/distributed-app/docs/modules/ROOT/pages/configure/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 — 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><mailet match="All" class="AddDeliveredToHeader"></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 <br></p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample Configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="RecipientIs=robot@james.apache.org" class="TagMessage"> |
| <subjectPrefix>[robot]</subjectPrefix> |
| </mailet></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<String, byte[]> |
| 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’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" |
| ("<>"), 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’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><mailet match="All" class="Bounce"> |
| <sender>*an address or postmaster or sender or unaltered, default=postmaster*</sender> |
| <attachError>*true or false, default=false*</attachError> |
| <message>*notice attached to the original message text (optional)*</message> |
| <prefix>*optional subject prefix prepended to the original message*</prefix> |
| <inline>*default=none*</inline> |
| <attachment>*default=message*</attachment> |
| <passThrough>*true or false, default=true*</passThrough> |
| <fakeDomainCheck>*true or false, default=true*</fakeDomainCheck> |
| <debug>*true or false, default=false*</debug> |
| </mailet></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><mailet match="All" class="Resend"> |
| <sender>*an address or postmaster or sender or unaltered*</sender> |
| <attachError>*true or false*</attachError> |
| <message>**dynamically built**</message> |
| <prefix>*a string*</prefix> |
| <passThrough>true or false</passThrough> |
| <fakeDomainCheck>*true or false*</fakeDomainCheck> |
| <recipients>*sender*</recipients> |
| <reversePath>null</reversePath> |
| <inline>see Resend</inline> |
| <attachment>see Resend</attachment> |
| <isReply>true</isReply> |
| <debug>*true or false*</debug> |
| </mailet></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><mailet match="All" class="ContactExtractor"> |
| <attribute>ExtractedContacts</attribute> |
| </mailet></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><mailet match=&quot;All&quot; class=&quot;DKIMSign&quot;> |
| <signatureTemplate>v=1; s=selector; d=example.com; h=from:to:received:received; a=rsa-sha256; bh=; b=;</signatureTemplate> |
| <privateKey> |
| -----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----- |
| </privateKey> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration with file-provided private key:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match=&quot;All&quot; class=&quot;DKIMSign&quot;> |
| <signatureTemplate>v=1; s=selector; d=example.com; h=from:to:received:received; a=rsa-sha256; bh=; b=;</signatureTemplate> |
| <privateKeyFilepath>dkim-signing.pem</privateKeyFilepath> |
| </mailet></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’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><mailet match="All" class="DKIMVerify"> |
| </mailet></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’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’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" |
| ("<>"), 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’s address will be used.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Supports the <code>passThrough</code> init parameter (true if missing).</p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="DSNBounce"> |
| <sender>*an address or postmaster or sender or unaltered, default=postmaster*</sender> |
| <prefix>*optional subject prefix prepended to the original message*</prefix> |
| <attachment>*message, heads or none, default=message*</attachment> |
| <messageString>*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] ... *</messageString> |
| <passThrough>*true or false, default=true*</passThrough> |
| <debug>*true or false, default=false*</debug> |
| </mailet></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_expires"><a class="anchor" href="#_expires"></a>Expires</h3> |
| <div class="paragraph"> |
| <p>Sanitizes or adds an expiration date to a message, in the form of an <code>Expires</code> |
| header (RFC 4021).</p> |
| </div> |
| <div class="paragraph"> |
| <p>The mailet can force an existing expiration date to be within the bounds |
| given by <code>minAge</code>, <code>maxAge</code>, or both. <code>minAge</code> specifies the minimum time |
| the date must lie in the future, while <code>maxAge</code> specifies a maximum.</p> |
| </div> |
| <div class="paragraph"> |
| <p>If a message has no expiration date, the mailet can add one according to |
| the optional <code>defaultAge</code> parameter.</p> |
| </div> |
| <div class="paragraph"> |
| <p>All parameter values should be expressed in the following format: <code>Nunit</code>. |
| <code>N</code> should be positive. <code>unit</code> could be either in the short form |
| (<code>h</code>, <code>d</code>, <code>w</code>, <code>y</code> etc.), or in the long form (<code>hours</code>, days`, <code>weeks</code>, |
| <code>months</code>, <code>years</code>). The default unit is <code>days</code>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="Expires"> |
| <minAge>12h</minAge> |
| <defaultAge>7d</defaultAge> |
| <maxAge>8w</maxAge> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>By itself the <code>Expires</code> header is informational only. But some variants of James |
| will let you delete expired messages through the |
| <a href="../operate/webadmin.html#_administrating_messages" class="xref page">WebAdmin</a> interface:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre>curl -XDELETE http://ip:port/messages?byExpiresHeader</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><forwardto></strong> with <strong><recipients></strong>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="Forward"> |
| <forwardTo>*comma delimited list of email addresses*</forwardTo> |
| <passThrough>*true or false, default=false*</passThrough> |
| <fakeDomainCheck>*true or false, default=true*</fakeDomainCheck> |
| <debug>*true or false, default=false*</debug> |
| </mailet></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><mailet match="All" class="Resend"> |
| <forwardTo>comma delimited list of email addresses</recipients> |
| <passThrough>true or false</passThrough> |
| <fakeDomainCheck>*true or false*</fakeDomainCheck> |
| <debug>*true or false*</debug> |
| </mailet></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> <mailet match="All" class="ICalendarParser" > |
| <sourceAttribute>source.attribute.name</sourceAttribute> |
| <!-- The attribute which contains output value of StripAttachment mailet -- > |
| <destAttribute>dest.attribute.name</destAttribute> |
| <!-- The attribute store the map of Calendar -- > |
| </mailet ></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><mailet match=??? class=ICALToHeader> |
| <attribute>icalendars</attribute> |
| </mailet></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><mailet match=??? class=ICALToJsonAttribute> |
| <sourceAttribute>icalendars</sourceAttribute> |
| <destinationAttribute>icalendarJson</destinationAttribute> |
| </mailet></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><mailet match="All" class="ICSSanitizer"/></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<String> to headers</p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="MailAttributesToMimeHeaders"> |
| <simplemapping>org.apache.james.attribute1;headerName1</simplemapping> |
| <simplemapping>org.apache.james.attribute2;headerName2</simplemapping> |
| </mailet></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<String> to headers</p> |
| </div> |
| <div class="paragraph"> |
| <p>Sample configuration:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="MailAttributesToMimeHeaders"> |
| <simplemapping>org.apache.james.attribute1;headerName1</simplemapping> |
| <simplemapping>org.apache.james.attribute2;headerName2</simplemapping> |
| </mailet></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><mailet match="all" class="MetricsMailet"> |
| <metricName>relayDenied</metricName> |
| </mailet></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<String, byte[]></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’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><mailet match="All" class="NotifyPostmaster"> |
| <sender>*an address or postmaster or sender or unaltered, default=postmaster*</sender> |
| <attachError>*true or false, default=false*</attachError> |
| <message>*notice attached to the original message text (optional)*</message> |
| <prefix>*optional subject prefix prepended to the original message, default="Re:"*</prefix> |
| <inline>*default=none*</inline> |
| <attachment>*default=message*</attachment> |
| <passThrough>*true or false, default=true*</passThrough> |
| <fakeDomainCheck>*true or false, default=true*</fakeDomainCheck> |
| <to>*unaltered (optional, defaults to postmaster)*</to> |
| <debug>*true or false, default=false*</debug> |
| </mailet></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><mailet match="All" class="Resend"> |
| <sender>*an address or postmaster or sender or unaltered*</sender> |
| <attachError>*true or false*</attachError> |
| <message>*<b>dynamically built</b>*</message> |
| <prefix>*a string*</prefix> |
| <passThrough>*true or false*</passThrough> |
| <fakeDomainCheck>*true or false*</fakeDomainCheck> |
| <to>*<b>unaltered or postmaster</b>*</to> |
| <recipients><b>postmaster</b></recipients> |
| <inline>see {@link Resend}</inline> |
| <attachment>see {@link Resend}</attachment> |
| <isReply>true</isReply> |
| <debug>*true or false*</debug> |
| </mailet></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’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><mailet match="All" class="NotifySender"> |
| <sender>*an address or postmaster or sender or unaltered, default=postmaster*</sender> |
| <attachError>*true or false, default=false*</attachError> |
| <prefix>*optional subject prefix prepended to the original message*</prefix> |
| <inline>default=none*</inline> |
| <attachment>default=message*</attachment> |
| <passThrough>*true or false, default=true*</passThrough> |
| <fakeDomainCheck>*true or false, default=true*</fakeDomainCheck> |
| <to>*unaltered or sender or from(optional, defaults to sender)*</to> |
| <debug>*true or false, default=false*</debug> |
| </mailet></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><mailet match="All" class="Resend"> |
| <sender>*an address or postmaster or sender or unaltered*</sender> |
| <attachError>*true or false*</attachError> |
| <message>*<b>dynamically built</b>*</message> |
| <prefix>*a string*</prefix> |
| <passThrough>true</passThrough> |
| <fakeDomainCheck>*true or false*</fakeDomainCheck> |
| <to>*unaltered or sender or from&lt*;/to> |
| <recipients><b>sender</b></recipients> |
| <inline>none</inline> |
| <attachment>message</attachment> |
| <isReply>true</isReply> |
| <debug>*true or false*</debug> |
| </mailet></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@<servernames> 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>Example:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre> <mailet match="All" class="RecipientRewriteTable"> |
| <errorProcessor>rrt-errors</errorProcessor> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The <strong>rewriteSenderUponForward</strong> option (default to true) can be used to prevent senders to be rewritten upon forwards in the transport envelope |
| (JAMES 3.8.0 default behaviour). <strong>WARNING</strong>: Please note that not rewriting the sender will cause issues forwarding emails |
| from external senders to external addresses as the DKIM and SPF records will not be matching the ones of the sending |
| domain.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The <strong>forwardAutoSubmittedEmails</strong> option (default to false) can be used to prevent forwarding bounces as such a scenario |
| can lead to an infinite loop if the forward recipient bounces the email.</p> |
| </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><recipients></strong>, |
| <strong><to></strong>, <strong><reversePath></strong> and <strong><inline></strong>; (ii) |
| because it allows the use of the <strong><static></strong> parameter;.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Use <code>Resend</code> if you need full control, <code>Redirect</code> 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 <b>"unaltered"</b> 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 |
| <<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>></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 |
| <<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>></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 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 &nbsp |
| ; Both headers and body are appended |
| * none |
| Neither body nor headers are appended |
| </ul> |
| 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 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’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 <>, |
| 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><sender></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><subject></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’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> <mailet match="RecipientIs=test@localhost" class="Redirect"> |
| <recipients>x@localhost, y@localhost, z@localhost</recipients> |
| <to>list@localhost</to> |
| <sender>owner@localhost</sender> |
| <message>sent on from James</message> |
| <inline>unaltered</inline> |
| <passThrough>FALSE</passThrough> |
| <replyTo>postmaster</replyTo> |
| <prefix xml:space="preserve">[test mailing] </prefix> |
| <!-- note the xml:space="preserve" to preserve whitespace --> |
| <static>TRUE</static> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>and:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre> <mailet match="All" class="Redirect"> |
| <recipients>x@localhost</recipients> |
| <sender>postmaster</sender> |
| <message xml:space="preserve">Message marked as spam:</message> |
| <inline>heads</inline> |
| <attachment>message</attachment> |
| <passThrough>FALSE</passThrough> |
| <attachError>TRUE</attachError> |
| <replyTo>postmaster</replyTo> |
| <prefix>[spam notification]</prefix> |
| <static>TRUE</static> |
| </mailet></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><gateway/></strong> parameter is set. The <strong><gateway/></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><delayTime/></strong> parameter, retrying up to the limit defined |
| by the <strong><maxRetries/></strong> parameter. When the retry limit is exceeded, delivery failure is processed |
| according to the setting of the <strong><bounceProcessor/></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.<br> |
| 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><delayTime>1 6 hour</delayTime></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><delayTime/></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>onSuccess</strong> (optional) - if specified, this processor is called for each email successfully sent to remote third parties.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>When using bounceProcessor or onSuccess processors, take special care of error handling (see onMailetException and onMatcherException) |
| to avoid confusing situations. Also remember that on partial delivery, both processors will be used: <strong>onSuccess</strong> with successfull recipients, |
| and <strong>bounceProcessor</strong> with failed recipients.</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <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. Setting up to true will result in delivery attempts in SMTPS on port 465 with a fallback |
| to SMTP on port 25. The trust-store if needed can be customized by <strong>-Djavax.net.ssl.trustStore=/root/conf/keystore</strong>.</p> |
| </li> |
| <li> |
| <p><strong>verifyServerIdentity</strong> (optional) - a Boolean (true/false) indicating whether to match the remote server name against its certificate on TLS connections. Default is true. Disabling this runs the risk of someone spoofing a legitimate server and intercepting mails, but may be necessary to contact servers that have strange certificates, no DNS entries, are reachable by IP address only, and similar edge cases.</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><gatewayPort/></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><gateway/></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>loadBalancing</strong> (optional) - a Boolean (true/false) indicating whether load should be balanced randomly over all defined gateway server. Default is true, false leads to failover only.</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 |
| <a href="https://eclipse-ee4j.github.io/angus-mail/docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/smtp/package-summary.html">*org.eclipse.angus.mail.smtp*</a> |
| can be set with a parameter of the corresponding name. For example the parameter |
| <strong><mail.smtp.ssl.enable>true</mail.smtp.ssl.enable></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.<br> |
| 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>sslEnable</strong> parameter described above to force SMTP outgoing delivery to default to SSL encrypted traffic (SMTPS). |
| This is a shortcut for the <strong>mail.smtps.ssl.enable</strong> javax property.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When enabling SSL, you might need to specify the <strong>mail.smtps.ssl.trust</strong> property as well. |
| You can also control ciphersuites and protocols via <strong>mail.smtps.ssl.ciphersuites</strong> and |
| <strong>mail.smtps.ssl.protocols</strong> properties.</p> |
| </div> |
| <div class="paragraph"> |
| <p>StartTLS can alternatively be enabled upon sending a mail. For this, use the <strong>startTls</strong> parameter, serving as a shortcut for the |
| 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. |
| You can also use other javax properties for StartTLS, but their property prefix must be <strong>mail.smtp.ssl.</strong> in this case.</p> |
| </div> |
| <div class="paragraph"> |
| <p>James enables server identity verification by default. In certain rare edge cases you might disable it via the <strong>verifyServerIdentity</strong> parameter, |
| or use the <strong>mail.smtps.ssl.checkserveridentity</strong> and <strong>mail.smtp.ssl.checkserveridentity</strong> javax properties for fine control.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Read <a href="https://eclipse-ee4j.github.io/angus-mail/docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/smtp/package-summary.html"><strong>org.eclipse.angus.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><mailet match="All" class="RemoveAllMailAttributes"/></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><mailet match="All" class="RemoveMailAttribute"> |
| <name>attribute_name1</name> |
| <name>attribute_name2</name> |
| </mailet></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><mailet match="All" class="RemoveMimeHeader"> |
| <name>header1,header2</name> |
| </mailet></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><mailet match="All" class="RemoveMimeHeaderByPrefix"> |
| <name>X-APPLICATIVE-HEADER-</name> |
| </mailet></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 <subjectPattern> and <bodyPattern></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 <subjectPatternFile> and |
| <bodyPatternFile> |
| 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 <charset> 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 <subjectPattern> or <bodyPattern> 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 <code>Resend</code> if you need full control, <code>Redirect</code> 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 <b>"unaltered"</b> 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 |
| <<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>></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 |
| <<a href="mailto:john.smith@xyz.com">john.smith@xyz.com</a>></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: |
| </p> |
| <ul> |
| * 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 &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’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 <>, 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><subject></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> <mailet match="RecipientIs=test@localhost" class="Resend"> |
| <recipients>x@localhost, y@localhost, z@localhost</recipients> |
| <to>list@localhost</to> |
| <sender>owner@localhost</sender> |
| <message>sent on from James</message> |
| <inline>unaltered</inline> |
| <passThrough>FALSE</passThrough> |
| <replyTo>postmaster</replyTo> |
| <prefix xml:space="preserve">[test mailing] </prefix> |
| <!-- note the xml:space="preserve" to preserve whitespace --> |
| <static>TRUE</static> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>and:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre> <mailet match="All" class="Resend"> |
| <recipients>x@localhost</recipients> |
| <sender>postmaster</sender> |
| <message xml:space="preserve">Message marked as spam:</message> |
| <inline>heads</inline> |
| <attachment>message</attachment> |
| <passThrough>FALSE</passThrough> |
| <attachError>TRUE</attachError> |
| <replyTo>postmaster</replyTo> |
| <prefix>[spam notification]</prefix> |
| </mailet></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> <mailet match="All" class="Resend&quot/;></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><mailet match="All" class="SetMailAttribute"> |
| <name1>value1</name1> |
| <name2>value2</name2> |
| </mailet></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><mailet match="All" class="AddHeader"> |
| <name>X-MailetHeader</name> |
| <value>TheHeaderValue</value> |
| </mailet></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><keyHolderClass>: 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><debug>: if <strong>true</strong> some useful information is logged. |
| The default is <strong>false</strong>.</p> |
| </li> |
| <li> |
| <p><keyStoreFileName>: the {@link java.security.KeyStore} full file name.</p> |
| </li> |
| <li> |
| <p><keyStorePassword>: 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><keyAlias>: 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><keyAliasPassword>: 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><keyStoreType>: the type of the keystore. The default will use {@link java.security.KeyStore#getDefaultType}.</p> |
| </li> |
| <li> |
| <p><postmasterSigns>: 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><rebuildFrom>: If <strong>true</strong> will modify the "From:" header. The default is <strong>true</strong>.</p> |
| </li> |
| <li> |
| <p><signerName>: 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><explanationText>. 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’s certificate and optionally a set of certificate that can be used to |
| create a chain of trust that starts from the signer’s certificate and leads |
| to a known trusted certificate.</p> |
| </div> |
| <div class="paragraph"> |
| <p>This check is composed by two steps: firstly it’s ensured that the signature |
| is valid, then it’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 message has not been modified after the signature |
| was put and that the signer’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’s signer. These objects contain the signer’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 <keyHolderClass> init parameter.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Handles the following init parameters:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><keyHolderClass>: 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><debug>: if <strong>true</strong> some useful information is logged. |
| The default is <strong>false</strong>.</p> |
| </li> |
| <li> |
| <p><keyStoreFileName>: the {@link java.security.KeyStore} full file name.</p> |
| </li> |
| <li> |
| <p><keyStorePassword>: 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><keyAlias>: 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><keyAliasPassword>: 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><keyStoreType>: the type of the keystore. The default will use {@link java.security.KeyStore#getDefaultType}.</p> |
| </li> |
| <li> |
| <p><postmasterSigns>: 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><rebuildFrom>: If <strong>true</strong> will modify the "From:" header. The default is <strong>true</strong>.</p> |
| </li> |
| <li> |
| <p><signerName>: 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><explanationText>. 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><mailet notmatch="SenderHostIsLocal" class="SpamAssassin"> |
| <spamdHost>localhost</spamdHost> |
| <spamdPort>783</spamdPort> |
| </mailet></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><mailet match=&quot;All&quot; class=&quot;StripAttachment&quot; > |
| <pattern >.*\.xls </pattern> <!-- The regular expression that must be matched -- > |
| <!-- notpattern >.*\.xls </notpattern--> <!-- The regular expression that must be matched -- > |
| <mimeType>text/calendar</mimeType> <!-- The matching mimeType -- > |
| <directory >c:\temp\james_attach </directory> <!-- The directory to save to -- > |
| <remove >all </remove> <!-- either &quot;no&quot;, &quot;matched&quot;, &quot;all&quot; -- > |
| <!-- attribute>my.attribute.name</attribute --> |
| </mailet ></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><mailet match="All" class="TextCalendarBodyToAttachment"/></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><mailet match="All" class="ToProcessor"> |
| <processor>spam</processor> |
| <notice>Notice attached to the message (optional)</notice> |
| </mailet></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’s domain.<br></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’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><mailet match="All" class="ToSenderDomainRepository"> |
| <urlPrefix>cassandra://var/mail/sendersRepositories/</urlPrefix> |
| <passThrough>false</passThrough> |
| <allowRepositoryCreation>true</allowRepositoryCreation> |
| </mailet></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><mailet match="All" class="WithPriority"> |
| <priority>7</priority> |
| </mailet></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 <strong>LocalDelivery</strong> 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>targetFolderNames: the folders to append the email in. Defaults to none (INBOX). Coma separated list of folder names. Fallback to targetFolderName.</p> |
| </li> |
| <li> |
| <p>targetFolderName: the folder to append the email in. Defaults to none (INBOX).</p> |
| </li> |
| <li> |
| <p>seen: boolean, whether the message should be automatically marked as seen. Defaults to false.</p> |
| </li> |
| <li> |
| <p>important: boolean, whether the message should be automatically marked as important. Defaults to false.</p> |
| </li> |
| <li> |
| <p>keywords: set of string, encoded as a string (value are coma separated). IMAP user flags to set for the message. Defaults to none</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Example:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="IsMarkedAsSpam" class="WithStorageDirective"> |
| <targetFolderName>Spam</targetFolderName> |
| <seen>true</seen> |
| <important>true</important> |
| <keywords>keyword1,keyword2</keywords> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Alternatively, several target folders can be specified:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="IsMarkedAsSpam" class="WithStorageDirective"> |
| <targetFolderNames>Important, INBOX</targetFolderNames> |
| <seen>true</seen> |
| <important>true</important> |
| <keywords>keyword1,keyword2</keywords> |
| </mailet></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</p>" class="bare">http://www.hebeas.com</p></a>;</p> |
| </div> |
| <div class="paragraph"> |
| <p>Usage:</p> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><mailet match="All" class="AddHabeasWarrantMark" />;</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, |
| * |
| > FURTHERMORE, if James is to be capable of sending Habeas SWE, I need |
| > to write a Mailet that attaches the headers. As with any MTA, it |
| > would be up to the administrator to properly configure James and make |
| > sure that licenses are acquired. Since the Habeas Warrant Mark is |
| > copyright, I believe that I require authorization from you for that |
| > Mailet, especially since it attaches the Habeas Warrant Mark. For my |
| > own protection, please show me why such authorization is unnecessary, |
| > 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. |
| * |
| > The Mailet docs would reference the Habeas website, and inform |
| > administrators that in order to USE the mailet, they need to ensure |
| > that they have whatever licenses are required from you as appropriate |
| > 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><debug></strong></p> |
| </li> |
| <li> |
| <p><strong><host></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><port></strong>: the port on which CLAMD listens. The default is <strong>3310</strong>.</p> |
| </li> |
| <li> |
| <p><strong><maxPings></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><pingIntervalMilli></strong>: the interval (in milliseconds) |
| between each connection retry during startup. |
| The default is <strong>30000</strong> (30 seconds).</p> |
| </li> |
| <li> |
| <p><strong><streamBufferSize></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><host></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><port></strong>;</p> |
| </li> |
| <li> |
| <p>if unsuccessful, retries every <strong><pingIntervalMilli></strong> milliseconds up to |
| <strong><maxPings></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><port></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>…​ 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 >= the James config.xml parameter |
| <*maxmessagesize*> in SMTP <*handler*></p> |
| </li> |
| <li> |
| <p><strong>MaxThreads</strong> should? be >= the James config.xml parameter |
| <*threads*> in <*spoolmanager*></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><!-- Do an antivirus scan --> |
| <mailet match="All" class="ClamAVScan" onMailetException="ignore"/> |
| |
| <!-- If infected go to virus processor --> |
| <mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor"> |
| <processor> virus </processor> |
| </mailet> |
| |
| <!-- Check attachment extensions for possible viruses --> |
| <mailet match="AttachmentFileNameIs=-d -z *.exe *.com *.bat *.cmd *.pif *.scr *.vbs *.avi *.mp3 *.mpeg *.shs" class="ToProcessor"> |
| <processor> bad-extensions </processor> |
| </mailet></pre> |
| </div> |
| </div> |
| <div class="literalblock"> |
| <div class="content"> |
| <pre><!-- Messages containing viruses --> |
| <processor name="virus"> |
| <!-- To avoid a loop while bouncing --> |
| <mailet match="All" class="SetMailAttribute"> |
| <org.apache.james.infected>true, bouncing</org.apache.james.infected> |
| </mailet> |
| |
| <mailet match="SMTPAuthSuccessful" class="Bounce"> |
| <sender>bounce-admin@xxx.com</sender> |
| <inline>heads</inline> |
| <attachment>none</attachment> |
| <notice> Warning: We were unable to deliver the message below because it was found infected by virus(es). </notice> |
| </mailet> |
| |
| <mailet match="All" class="ToRepository"> |
| <repositoryPath>file://var/mail/infected/</repositoryPath> |
| </mailet> |
| |
| <mailet match="All" class="Null" /> |
| </processor></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><mailet match="All" class="ClassifyBounce"> |
| <headerName>X-MailetHeader</headerName> |
| </mailet></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><mailet match="RecipientIs=respool@localhost" class="FromRepository"> |
| <repositoryPath> *repository path* </repositoryPath> |
| <processor> *target processor* </repositoryPath> |
| <delete&t; [true|<b>false</b>] </delete> |
| </mailet></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><mailet match="All" class="HeadersToHTTP"> |
| <url>http://192.168.0.252:3000/alarm</url> |
| <parameterKey>Test</parameterKey> |
| <parameterValue>ParameterValue</parameterValue> |
| <passThrough>true</passThrough> |
| </mailet></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’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 ⇒ with a conversion to text only</p> |
| </li> |
| <li> |
| <p>text/* as is.</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_manage_sieve_scripts_via_a_mailet"><a class="anchor" href="#_manage_sieve_scripts_via_a_mailet"></a>Manage Sieve scripts via a mailet</h3> |
| <div class="paragraph"> |
| <p>Each user can manage his SIEVE scripts through the <code>ManageSieveMailet</code> mailet.</p> |
| </div> |
| <div class="paragraph"> |
| <p>To use the manage SIEVE mailet :</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>You need to create the user sievemanager@DOMAIN ( if you don’t, the SMTP server will check the domain, recognize it, and look for an absent local user, and will generate an error ).</p> |
| </li> |
| <li> |
| <p>You can send Manage Sieve commands by mail to sievemanager@DOMAIN. Your subject must contain the command. Scripts need to be added as attachments and need the ".sieve" extension.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>To activate a script for a user, you need the following combination :</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>PUTSCRIPT scriptname</p> |
| </li> |
| <li> |
| <p>SETACTIVE scriptname</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> <mailet match="All" class="RecoverAttachment" > |
| <attribute>my.attribute.name</attribute> |
| </mailet ></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><mailet match="All" class="SerialiseToHTTP"> |
| <name>URL</name> <value>url where serialised message will be posted</value> |
| <name>ParameterKey</name> <value>An arbitrary parameter be added to the post</value> |
| <name>ParameterValue</name> <value>A value for the arbitrary parameter</value> |
| <name>MessageKeyName</name> <value>Field name for the serialised message</value> |
| <name>passThrough</name> <value>true or false</value> |
| </mailet></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><mailet match="RecipientIs=time@cadenza.lokitech.com" class="ServerTime"/></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><mailet match="All" class="SPF"> |
| <addHeader>true</addHeader> |
| <debug>false</debug> |
| </mailet></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_toplaintext"><a class="anchor" href="#_toplaintext"></a>ToPlainText</h3> |
| <div class="paragraph"> |
| <p>This mailet converts HTML parts of a message into Plain text.</p> |
| </div> |
| <div class="paragraph"> |
| <p>It starts looking for multipart/alternative containing a text/plain and a text/html part |
| and only keep the text/plain part. Then in a second pass replaces remaining text/html by |
| their textual content, infered by parsing the HTML content and handling common tags.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Eg:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre><mailet matcher="All" class="ToPlainText"/></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><mailet match="RecipientIsLocal" class="ToSenderFolder"> |
| <folder> *Sent Items* </folder> |
| <consume> *false* </consume> |
| </mailet></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 ">" 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 "> " 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><mailet match="RecipientIs=forwarded@myhost" class="UseHeaderRecipients"> |
| </mailet></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> |