http://git-wip-us.apache.org/repos/asf/james-site/blob/4c2da3c0/content/mailet-report.html ---------------------------------------------------------------------- diff --git a/content/mailet-report.html b/content/mailet-report.html new file mode 100644 index 0000000..947f8d1 --- /dev/null +++ b/content/mailet-report.html @@ -0,0 +1,1395 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- Generated by Apache Maven Doxia at 14 juin 2017 --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" /> + <title>Mailet and Matchers Reference</title> + <style type="text/css" media="all"> + @import url("./css/maven-base.css"); + @import url("./css/maven-theme.css"); + @import url("./css/site.css"); + </style> + <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" /> + <meta name="Date-Revision-yyyymmdd" content="20170614" /> + <meta http-equiv="Content-Language" content="fr" /> + + </head> + <body class="composite"> + <div id="banner"> + <a href="../index.html" id="bannerLeft" title="james-logo.png"> + + + <img src="../images/logos/james-logo.png" alt="James Project" /> + </a> + <a href="http://www.apache.org/index.html" id="bannerRight"> + + + <img src="images/logos/asf_logo_small.png" alt="The Apache Software Foundation" /> + </a> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + + + <div class="xleft"> + <span id="publishDate">Last Published: 2017-06-14</span> + </div> + <div class="xright"> <a href="../index.html" title="Home">Home</a> + | + <a href="../documentation.html" title="James">James</a> + | + <a href="../mime4j/index.html" title="Mime4J">Mime4J</a> + | + <a href="../jsieve/index.html" title="jSieve">jSieve</a> + | + <a href="../jspf/index.html" title="jSPF">jSPF</a> + | + <a href="../jdkim/index.html" title="jDKIM">jDKIM</a> + | + <a href="../hupa/index.html" title="Hupa">Hupa</a> + + + </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + + + <h5>James components</h5> + <ul> + +<li class="collapsed"> + <a href="../documentation.html" title="About James">About James</a> + </li> + +<li class="expanded"> + <a href="../server/index.html" title="Server">Server</a> + <ul> + <li class="none"> + <a href="../server/advantages.html" title="Advantages">Advantages</a> + </li> + <li class="none"> + <a href="../server/objectives.html" title="Objectives">Objectives</a> + </li> + +<li class="expanded"> + <a href="../server/quick-start.html" title="User Manual">User Manual</a> + <ul> + <li class="collapsed"> + <a href="../server/features.html" title="1. Features">1. Features</a> + </li> + <li class="none"> + <a href="../server/packaging.html" title="2. Packaging">2. Packaging</a> + </li> + <li class="none"> + <a href="../server/install.html" title="3. Install James">3. Install James</a> + </li> + +<li class="expanded"> + <strong>4. Configure James</strong> + <ul> + <li class="none"> + <a href="../server/config-system.html" title="System">System</a> + </li> + <li class="none"> + <a href="../server/config-domainlist.html" title="Domain List">Domain List</a> + </li> + <li class="none"> + <a href="../server/config-users.html" title="Users">Users</a> + </li> + <li class="none"> + <a href="../server/config-recipientrewritetable.html" title="Recipient Rewrite">Recipient Rewrite</a> + </li> + <li class="none"> + <a href="../server/config-mailbox.html" title="Mailbox">Mailbox</a> + </li> + <li class="none"> + <a href="../server/config-mailrepositorystore.html" title="Mail Repository Stores">Mail Repository Stores</a> + </li> + <li class="none"> + <a href="../server/config-dnsservice.html" title="DNS Service">DNS Service</a> + </li> + <li class="none"> + <a href="../server/config-smtp-lmtp.html" title="SMTP LMTP">SMTP LMTP</a> + </li> + <li class="none"> + <a href="../server/config-pop3.html" title="POP3">POP3</a> + </li> + <li class="none"> + <a href="../server/config-imap4.html" title="IMAP4">IMAP4</a> + </li> + <li class="none"> + <a href="../server/config-mailetcontainer.html" title="Mailet Container">Mailet Container</a> + </li> + <li class="none"> + <a href="../server/config-fetchmail.html" title="FetchMail">FetchMail</a> + </li> + <li class="none"> + <a href="../server/config-ssl-tls.html" title="SSL/TLS">SSL/TLS</a> + </li> + <li class="none"> + <a href="../server/config-sieve.html" title="Sieve">Sieve</a> + </li> + <li class="none"> + <a href="../server/config-antispam.html" title="Anti Spam">Anti Spam</a> + </li> + <li class="none"> + <a href="../server/config-guice.html" title="Guice">Guice</a> + </li> + <li class="none"> + <a href="../server/config-elasticsearch.html" title="ElasticSearch">ElasticSearch</a> + </li> + <li class="none"> + <a href="../server/config-cassandra.html" title="Cassandra">Cassandra</a> + </li> + <li class="none"> + <a href="../server/config-quota.html" title="Quota">Quota</a> + </li> + <li class="none"> + <a href="../server/config-events.html" title="Events">Events</a> + </li> + </ul> + </li> + <li class="collapsed"> + <a href="../server/manage.html" title="5. Manage">5. Manage</a> + </li> + <li class="collapsed"> + <a href="../server/monitor.html" title="6. Monitor">6. Monitor</a> + </li> + <li class="collapsed"> + <a href="../server/upgrade.html" title="7. Upgrade">7. Upgrade</a> + </li> + +<li class="collapsed"> + <a href="../server/dev.html" title="8. Developers Corner">8. Developers Corner</a> + </li> + </ul> + </li> + <li class="none"> + <a href="../mail.html#James_Mailing_lists" title="Mailing Lists">Mailing Lists</a> + </li> + <li class="none"> + <a href="../server/release-notes.html" title="Release Notes">Release Notes</a> + </li> + <li class="none"> + <a href="../server/apidocs/index.html" title="Javadoc">Javadoc</a> + </li> + <li class="none"> + <a href="https://issues.apache.org/jira/browse/JAMES" title="Issue Tracker">Issue Tracker</a> + </li> + <li class="none"> + <a href="https://github.com/apache/james-project" title="Sources">Sources</a> + </li> + <li class="none"> + <a href="../server/rfcs.html" title="RFCs">RFCs</a> + </li> + <li class="none"> + <a href="../other-versions.html" title="Other versions">Other versions</a> + </li> + <li class="none"> + <a href="../download.cgi#Apache_James_Server" title="Download releases">Download releases</a> + </li> + </ul> + </li> + +<li class="collapsed"> + <a href="../mailet/index.html" title="Mailets">Mailets</a> + </li> + +<li class="collapsed"> + <a href="../mailbox/index.html" title="Mailbox">Mailbox</a> + </li> + <li class="collapsed"> + <a href="../protocols/index.html" title="Protocols">Protocols</a> + </li> + <li +class="collapsed"> + <a href="../mpt/index.html" title="MPT">MPT</a> + </li> + </ul> + <h5>Apache Software Foundation</h5> + <ul> + <li> + <strong> + <a title="ASF" href="http://www.apache.org/">ASF</a> + </strong> + </li> + <li> + <a title="Get Involved" href="http://www.apache.org/foundation/getinvolved.html">Get Involved</a> + </li> + <li> + <a title="FAQ" href="http://www.apache.org/foundation/faq.html">FAQ</a> + </li> + <li> + <a title="License" href="http://www.apache.org/licenses/" >License</a> + </li> + <li> + <a title="Sponsorship" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a> + </li> + <li> + <a title="Thanks" href="http://www.apache.org/foundation/thanks.html">Thanks</a> + </li> + <li> + <a title="Security" href="http://www.apache.org/security/">Security</a> + </li> + </ul> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img class="poweredBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /> + </a> + + + </div> + </div> +<div id="bodyColumn"> + <div id="contentBox"> + <div class="section"><h2>Mailets and Matchers Reference<a name="Mailets_and_Matchers_Reference"></a></h2>Items marked as Experimental are not yet supported by James; however, you can try them.</div><table border="0" class="bodyTable"><tr class="a"><td><div class="section"><h3>Matchers<a name="Matchers"></a></h3><ul><li><a href="#AbstractQuotaMatcher">AbstractQuotaMatcher (Experimental)</a></li><li><a href="#All">All</a></li><li><a href="#AttachmentFileNameIs">AttachmentFileNameIs (Experimental)</a></li><li><a href="#CommandForListserv">CommandForListserv (Experimental)</a></li><li><a href="#CommandListservMatcher">CommandListservMatcher (Experimental)</a></li><li><a href="#CompareNumericHeaderValue">CompareNumericHeaderValue (Experimental)</a></li><li><a href="#FetchedFrom">FetchedFrom</a></li><li><a href="#FileRegexMatcher">FileRegexMatcher (Experimental)</a></li><li><a href="#GenericMatcher">GenericMatcher</a></li><li><a href="#GenericRecipientMatcher">GenericRecipientMatc her</a></li><li><a href="#GenericRegexMatcher">GenericRegexMatcher</a></li><li><a href="#HasAttachment">HasAttachment</a></li><li><a href="#HasHabeasWarrantMark">HasHabeasWarrantMark (Experimental)</a></li><li><a href="#HasHeader">HasHeader</a></li><li><a href="#HasMailAttribute">HasMailAttribute</a></li><li><a href="#HasMailAttributeWithValue">HasMailAttributeWithValue</a></li><li><a href="#HasMailAttributeWithValueRegex">HasMailAttributeWithValueRegex</a></li><li><a href="#HostIs">HostIs</a></li><li><a href="#HostIsLocal">HostIsLocal</a></li><li><a href="#IsSMIMEEncrypted">IsSMIMEEncrypted</a></li><li><a href="#IsSMIMESigned">IsSMIMESigned</a></li><li><a href="#IsSingleRecipient">IsSingleRecipient</a></li><li><a href="#IsX509CertificateSubject">IsX509CertificateSubject</a></li><li><a href="#MatcherInverter">MatcherInverter</a></li><li><a href="#NESSpamCheck">NESSpamCheck (Experimental)</a></li><li><a href="#RecipientIs">RecipientIs</a></li><li><a href="#RecipientIsLocal">Recipient IsLocal</a></li><li><a href="#RecipientIsRegex">RecipientIsRegex</a></li><li><a href="#RelayLimit">RelayLimit</a></li><li><a href="#SMTPAuthSuccessful">SMTPAuthSuccessful</a></li><li><a href="#SMTPAuthUserIs">SMTPAuthUserIs</a></li><li><a href="#SMTPIsAuthNetwork">SMTPIsAuthNetwork (Experimental)</a></li><li><a href="#SenderHostIs">SenderHostIs</a></li><li><a href="#SenderHostIsLocal">SenderHostIsLocal</a></li><li><a href="#SenderIs">SenderIs</a></li><li><a href="#SenderIsLocal">SenderIsLocal</a></li><li><a href="#SenderIsNull">SenderIsNull</a></li><li><a href="#SenderIsRegex">SenderIsRegex</a></li><li><a href="#SentByMailet">SentByMailet</a></li><li><a href="#SizeGreaterThan">SizeGreaterThan</a></li><li><a href="#SubjectIs">SubjectIs</a></li><li><a href="#SubjectStartsWith">SubjectStartsWith</a></li><li><a href="#TooManyLines">TooManyLines</a></li><li><a href="#TooManyRecipients">TooManyRecipients</a></li><li><a href="#UserIs">UserIs</a></li></ul></div></td><td><div class="section" ><h3>Mailets<a name="Mailets"></a></h3><ul><li><a >href="#AbstractSign">AbstractSign</a></li><li><a >href="#AddDeliveredToHeader">AddDeliveredToHeader</a></li><li><a >href="#AddFooter">AddFooter</a></li><li><a >href="#AddHabeasWarrantMark">AddHabeasWarrantMark >(Experimental)</a></li><li><a >href="#AddSubjectPrefix">AddSubjectPrefix</a></li><li><a >href="#AmqpForwardAttribute">AmqpForwardAttribute</a></li><li><a >href="#BayesianAnalysis">BayesianAnalysis (Experimental)</a></li><li><a >href="#BayesianAnalysisFeeder">BayesianAnalysisFeeder >(Experimental)</a></li><li><a href="#ClamAVScan">ClamAVScan >(Experimental)</a></li><li><a href="#ClassifyBounce">ClassifyBounce >(Experimental)</a></li><li><a href="#Counter">Counter</a></li><li><a >href="#DumpSystemErr">DumpSystemErr</a></li><li><a >href="#ExceptionThrowingMailet">ExceptionThrowingMailet</a></li><li><a >href="#GenericMailet">GenericMailet</a></li><li><a >href="#HeadersToHTTP">HeadersToHTTP (Experimental)</a></li><li><a >href="#ICALToHeader">ICALT oHeader</a></li><li><a href="#ICALToJsonAttribute">ICALToJsonAttribute</a></li><li><a href="#ICalendarParser">ICalendarParser</a></li><li><a href="#Identity">Identity</a></li><li><a href="#LogMessage">LogMessage</a></li><li><a href="#MailAttributesToMimeHeaders">MailAttributesToMimeHeaders</a></li><li><a href="#MimeDecodingMailet">MimeDecodingMailet</a></li><li><a href="#Null">Null</a></li><li><a href="#OnlyText">OnlyText (Experimental)</a></li><li><a href="#PostmasterAlias">PostmasterAlias</a></li><li><a href="#RecipientToLowerCase">RecipientToLowerCase</a></li><li><a href="#RecoverAttachment">RecoverAttachment (Experimental)</a></li><li><a href="#RemoveAllMailAttributes">RemoveAllMailAttributes</a></li><li><a href="#RemoveMailAttribute">RemoveMailAttribute</a></li><li><a href="#RemoveMimeHeader">RemoveMimeHeader</a></li><li><a href="#ReplaceContent">ReplaceContent</a></li><li><a href="#SMIMECheckSignature">SMIMECheckSignature</a></li><li><a href="#SMIMEDecrypt">SMIMEDecrypt</a></l i><li><a href="#SMIMESign">SMIMESign</a></li><li><a href="#SerialiseToHTTP">SerialiseToHTTP (Experimental)</a></li><li><a href="#ServerTime">ServerTime (Experimental)</a></li><li><a href="#SetMailAttribute">SetMailAttribute</a></li><li><a href="#SetMimeHeader">SetMimeHeader</a></li><li><a href="#Sign">Sign</a></li><li><a href="#StripAttachment">StripAttachment</a></li><li><a href="#ToProcessor">ToProcessor</a></li><li><a href="#UnwrapText">UnwrapText (Experimental)</a></li><li><a href="#UseHeaderRecipients">UseHeaderRecipients (Experimental)</a></li><li><a href="#WrapText">WrapText (Experimental)</a></li></ul></div></td></tr></table><div class="section"><h2>Matchers<a name="Matchers"></a></h2><div class="section"><h3><a name="AbstractQuotaMatcher">AbstractQuotaMatcher (Experimental)</a><a name="AbstractQuotaMatcher_Experimental"></a></h3><p><P>Abstract matcher checking whether a recipient has exceeded a maximum allowed quota.</P> +<P>"Quota" at this level is an abstraction whose specific interpretation +will be done by subclasses.</P> +<P>Although extending GenericMatcher, its logic is recipient oriented.</P></p></div><div class="section"><h3><a name="All">All</a></h3><p>Matches all mail.</p></div><div class="section"><h3><a name="AttachmentFileNameIs">AttachmentFileNameIs (Experimental)</a><a name="AttachmentFileNameIs_Experimental"></a></h3><p><P>Checks if at least one attachment has a file name which matches any +element of a comma-separated or space-separated list of file name masks.</P> +<P>Syntax: <CODE>match="AttachmentFileNameIs=[-d] [-z] <I>masks</I>"</CODE></P> +<P>The match is case insensitive.</P> +<P>File name masks may start with a wildcard '*'.</P> +<P>Multiple file name masks can be specified, e.g.: '*.scr,*.bat'.</P> +<P>If '<CODE>-d</CODE>' is coded, some debug info will be logged.</P> +<P>If '<CODE>-z</CODE>' is coded, the check will be non-recursively applied +to the contents of any attached '*.zip' file.</P></p></div><div class="section"><h3><a name="CommandForListserv">CommandForListserv (Experimental)</a><a name="CommandForListserv_Experimental"></a></h3><p>Returns positive if the recipient is a command for a listserv. For example, +if my listserv is ja...@list.working-dogs.com, this matcher will return true +for james...@list.working-dogs.com and james-...@list.working-dogs.com.</p></div><div class="section"><h3><a name="CommandListservMatcher">CommandListservMatcher (Experimental)</a><a name="CommandListservMatcher_Experimental"></a></h3><p>CommandListservMatcher is the matcher that pairs with the CommandListservManager +It checks to see if the request is intended for the ListservManager, but doesn't guarantee that it is a valid command. +<br /> +To configure, insert this into the config.xml inside of the root processor block. +<pre> +<mailet match="CommandListservMatcher=announce@localhost" class="CommandListservManager"> +... +</mailet> +</pre></p></div><div class="section"><h3><a name="CompareNumericHeaderValue">CompareNumericHeaderValue (Experimental)</a><a name="CompareNumericHeaderValue_Experimental"></a></h3><p><P>Matches mails containing a header with a numeric value whose comparison with the specified value is true. +If the header is missing in the message, there will be <I>no match</I></P> +<P>Configuration string: The headerName, a comparison operator and the numeric headerValue +to compare with, <I>space or tab delimited</I>.</P> +<P>The comparison operators are: <CODE><, <=, ==, >=, ></CODE>; +another set of operators is: <CODE>LT, LE, EQ, GE, GT</CODE>. +Also the following operators are accepted: <CODE>=<, =, =></CODE>.</P> +<P>Example:</P> +<PRE><CODE> + <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability > 0.9" class="ToProcessor"> + <processor> spam </processor> + </mailet> +</CODE></PRE></p></div><div class="section"><h3><a name="FetchedFrom">FetchedFrom</a></h3><p>Matches mail with a header set by Fetchpop X-fetched-from <br> +fetchpop sets X-fetched-by to the "name" of the fetchpop fetch task.<br> +This is used to match all mail fetched from a specific pop account. +Once the condition is met the header is stripped from the message to prevent looping if the mail is re-inserted into the spool. + +$Id$</p></div><div class="section"><h3><a name="FileRegexMatcher">FileRegexMatcher (Experimental)</a><a name="FileRegexMatcher_Experimental"></a></h3><p>Initializes RegexMatcher with regular expressions from a file.</p></div><div class="section"><h3><a name="GenericMatcher">GenericMatcher</a></h3><p><p>GenericMatcher implements the Matcher and MatcherConfig interfaces.</p> +<p>GenericMatcher makes writing matchers easier. It provides simple versions of +the lifecycle methods init and destroy and of the methods in the MatcherConfig +interface. GenericMatcher also implements the log method, declared in the +MatcherContext interface.</p> + +<p>To write a generic matcher, you need only override the abstract match method.</p></p></div><div class="section"><h3><a name="GenericRecipientMatcher">GenericRecipientMatcher</a></h3><p>GenericMatcher makes writing recipient based matchers easier. It provides +simple versions of the lifecycle methods init and destroy and of the methods +in the MatcherConfig interface. GenericMatcher also implements the log method, +declared in the MatcherContext interface.</p></div><div class="section"><h3><a name="GenericRegexMatcher">GenericRegexMatcher</a></h3><p>This is a generic matcher that uses regular expressions. If any of +the regular expressions match, the matcher is considered to have +matched. This is an abstract class that must be subclassed to feed +patterns. Patterns are provided by calling the compile method. A +subclass will generally call compile() once during init(), but it +could subclass match(), and call it as necessary during message +processing (e.g., if a file of expressions changed).</p></div><div class="section"><h3><a name="HasAttachment">HasAttachment</a></h3><p>Checks whether this message has an attachment</p></div><div class="section"><h3><a name="HasHabeasWarrantMark">HasHabeasWarrantMark (Experimental)</a><a name="HasHabeasWarrantMark_Experimental"></a></h3><p>Matcher Info: <b>Habeas Warrant Mark Matcher (see http://www.habeas.com for details).</b><br /></p><p><p>This matcher tests for the Hebeas Warrant Mark. +For details see: http://www.hebeas.com</p> + +<p>Usage: Place this matcher</p> +<pre><code> +<mailet match="HasHabeasWarrantMark" class="ToProcessor"> + <processor> transport </processor> +</mailet> +</code></pre> +<p>in the root processs before the DNSRBL block lists (the InSpammerBlacklist matcher).</p> + +<p>Because the Habeas Warrant Mark is copyright material, I have asked for and +received the following explicit statement from Habeas:</p> +<pre> +----------------------------------- +From: Lindsey Pettit [mailto:supp...@habeas.com] +Sent: Sunday, September 29, 2002 5:51 +To: Noel J. Bergman +Subject: RE: Habeas and Apache James + +Dear Noel, + +> I guess that since your Warrant Mark is copyright, I should ask for +> something from you to explicitly authorize that Hebeas will permit +> this code to be included and distributed as part of Apache James +> under the Apache Software License. As we have established, the use +> of the Habeas Warrant Mark for filtering is not restricted, but I +> would like something to confirm that, so that Apache will be happy. + +I can hereby confirm to you that there is no license necessary in +order to use the Habeas mark for filtering. That said, however, we +do insist that it not ever be used as a basis for rejecting email which +bears the Habeas mark. +----------------------------------- +</pre></p></div><div class="section"><h3><a name="HasHeader">HasHeader</a></h3><p>use: <pre><code><mailet match="HasHeader={<header>[=value]}+" class="..." /></code></pre> +<p/> +<p>This matcher checks if the header named is present. If complements the +AddHeader mailet.</p></p></div><div class="section"><h3><a name="HasMailAttribute">HasMailAttribute</a></h3><p>Matcher Info: <b>Has Mail Attribute Matcher</b><br /></p><p><P>This Matcher determines if the mail contains the attribute specified in the +condition, and returns all recipients if it is the case.</P> +<P>Sample configuration:</P> +<PRE><CODE> +<mailet match="HasMailAttribute=whatever" class="<any-class>"> +</CODE></PRE></p></div><div class="section"><h3><a name="HasMailAttributeWithValue">HasMailAttributeWithValue</a></h3><p>Matcher Info: <b>Has Mail Attribute With Value Matcher</b><br /></p><p><p>This Matcher determines if the mail contains the attribute specified in +the condition and if the value answered when the method toString() is +invoked on the attribute is equal to the String value specified in the +condition. If both tests are true, all recipients are returned, else null. +</p> + +<p>Notes:</p> +<p>The current matcher implementation expects a single String value to match +on. This matcher requires two values, the attribute name and attribute +value. This requires some implicit rules to govern how the single value +supplied to the matcher is parsed into two values.</p> +<ul> +<li>In the match condition, the split between the attribute name and the +attribute value is made at the first comma. Attribute names that include +a comma will parse incorrectly and therefore are not supported by this +matcher. +</li> +<li>Leading and trailing spaces are removed from both the attribute name and +attribute value specified in the condition and the tested attribute value in +the mail prior to matching. Therefore, "abc" , " abc", "abc " and " abc " +are considered equivalent. +</li> +<li>To test for an empty string, do not specify an attribute value after the +comma. +</li> +</ul> + +<p>Sample configuration:</p> +<pre><code> +<mailet match="HasMailAttributeWithValue=name, value" class="<any-class>"> +</code></pre></p></div><div class="section"><h3><a name="HasMailAttributeWithValueRegex">HasMailAttributeWithValueRegex</a></h3><p>Matcher Info: <b>Has Mail Attribute Value Matcher</b><br /></p><p><P>This Matcher determines if the mail contains the attribute specified in the +condition and that attribute matches the supplied regular expression, +it returns all recipients if that is the case.</P> +<P>Sample configuration:</P> +<PRE><CODE> +<mailet match="HasMailAttributeWithValueRegex=whatever,<regex>" class="<any-class>"> +</CODE></PRE> +Note: as it is not possible to put arbitrary objects in the configuration, +toString() is called on the attribute value, and that is the value matched against.</p></div><div class="section"><h3><a name="HostIs">HostIs</a></h3><p>Matches mail to given hosts.</p></div><div class="section"><h3><a name="HostIsLocal">HostIsLocal</a></h3><p>Matches mail to Domains which are local +.</p></div><div class="section"><h3><a name="IsSMIMEEncrypted">IsSMIMEEncrypted</a></h3><p>Checks if a mail is smime encrypted.</p></div><div class="section"><h3><a name="IsSMIMESigned">IsSMIMESigned</a></h3><p>checks if a mail is smime signed.</p></div><div class="section"><h3><a name="IsSingleRecipient">IsSingleRecipient</a></h3><p>Matches mail where the number of recipiants is exactly one.</p></div><div class="section"><h3><a name="IsX509CertificateSubject">IsX509CertificateSubject</a></h3><p><p> +Checks if the subject of a X509Certificate contains the supplied string. The +certificate is read from the specified mail attribute. +</p><p> +If the specified attribute contains more than one certificate the matcher matches if at +least one of the certificates contains the given string. +</p> +<p> +Configuration string: +<ul> +<li>mailAttribute;string</li> +</ul></p></div><div class="section"><h3><a name="MatcherInverter">MatcherInverter</a></h3><p>This class can be used as a wrapper for getting the "not matched" recipients</p></div><div class="section"><h3><a name="NESSpamCheck">NESSpamCheck (Experimental)</a><a name="NESSpamCheck_Experimental"></a></h3><p>This is based on a sample filter.cfg for a Netscape Mail Server to stop +spam.</p></div><div class="section"><h3><a name="RecipientIs">RecipientIs</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="RecipientIsLocal">RecipientIsLocal</a></h3><p>Matches mail where the recipient is local.</p></div><div class="section"><h3><a name="RecipientIsRegex">RecipientIsRegex</a></h3><p><P>Matches recipients whose address matches a regular expression.</P> +<P>Is equivalent to the {@link SenderIsRegex} matcher but matching on the recipient.</P> +<P>Configuration string: a regular expression.</P> +<PRE><CODE> +<mailet match="RecipientIsRegex=<regular-expression>" class="<any-class>"> +</CODE></PRE> +<P>The example below will match any recipient in the format user@log.anything</P> +<PRE><CODE> +<mailet match="RecipientIsRegex=(.*)@log\.(.*)" class="<any-class>"> +</mailet> +</CODE></PRE></p></div><div class="section"><h3><a name="RelayLimit">RelayLimit</a></h3><p>Matches mail which has been relayed more than a given number of times.</p></div><div class="section"><h3><a name="SMTPAuthSuccessful">SMTPAuthSuccessful</a></h3><p><P>Matches mails that are sent by an SMTP authenticated user.</P> +<P>If the sender was not authenticated it will not match.</P> +<PRE><CODE> +<mailet match="SMTPAuthSuccessful" class="<any-class>"> +</CODE></PRE></p></div><div class="section"><h3><a name="SMTPAuthUserIs">SMTPAuthUserIs</a></h3><p><P>Matches mails that are sent by an SMTP authenticated user present in a supplied list.</P> +<P>If the sender was not authenticated it will not match.</P> +<P>Configuration string: a comma, tab or space separated list of James users.</P> +<PRE><CODE> +<mailet match="SMTPAuthUserIs=<list-of-user-names>" class="<any-class>"> +</CODE></PRE></p></div><div class="section"><h3><a name="SMTPIsAuthNetwork">SMTPIsAuthNetwork (Experimental)</a><a name="SMTPIsAuthNetwork_Experimental"></a></h3><p><P> +Matches mails that are sent by an client which is allowed to relay. +</P> + +<PRE><CODE> <mailet match="SMTPIsAuthNetwork" +class="<any-class>"> </CODE></PRE></p></div><div class="section"><h3><a name="SenderHostIs">SenderHostIs</a></h3><p><p>Checkes the sender's displayed domain name against a supplied list.</p> + +<p>Sample configuration:</p> +<pre><code> +<mailet match="SenderHostIs=domain.com" class="ToProcessor"> + <processor> spam </processor> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="SenderHostIsLocal">SenderHostIsLocal</a></h3><p>Checks the sender's displayed domain name against a the hosts serviced by +this mail context. <br> +<br> +Sample Configuration: <br> +<br> +<mailet match="SenderHostIsLocal" class="SpamAssassin"> </mailet> +<br> +<br></p></div><div class="section"><h3><a name="SenderIs">SenderIs</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="SenderIsLocal">SenderIsLocal</a></h3><p>Matches mail where the sender is local.</p></div><div class="section"><h3><a name="SenderIsNull">SenderIsNull</a></h3><p><P>Matches mails that are sent by a null sender.</P> +<PRE><CODE> +<mailet match="SenderIsNull" class="<any-class>"> +</CODE></PRE></p></div><div class="section"><h3><a name="SenderIsRegex">SenderIsRegex</a></h3><p><P>Matches mails that are sent by a sender whose address matches a regular expression.</P> +<P>Is equivalent to the {@link RecipientIsRegex} matcher but matching on the sender.</P> +<P>Configuration string: a regular expression.</P> +<PRE><CODE> +<mailet match="SenderIsRegex=<regular-expression>" class="<any-class>"> +</CODE></PRE> +<P>The example below will match any sender in the format user@log.anything</P> +<PRE><CODE> +<mailet match="SenderIsRegex=(.*)@log\.(.*)" class="<any-class>"> +</mailet> +</CODE></PRE> +<P>Another example below will match any sender having some variations of the string +<I>mp3</I> inside the username part.</P> +<PRE><CODE> +<mailet match="SenderIsRegex=(.*)(mp3|emmepitre)(.*)@" class="<any-class>"> +</mailet> +</CODE></PRE></p></div><div class="section"><h3><a name="SentByMailet">SentByMailet</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="SizeGreaterThan">SizeGreaterThan</a></h3><p>Checks whether the message (entire message, not just content) is greater +than a certain number of bytes. You can use 'k' and 'm' as optional postfixes. +In other words, "1m" is the same as writing "1024k", which is the same as +"1048576".</p></div><div class="section"><h3><a name="SubjectIs">SubjectIs</a></h3><p>Matches mail where the subject is contained in a configurable list.</p></div><div class="section"><h3><a name="SubjectStartsWith">SubjectStartsWith</a></h3><p>Matches mail where the subject starts with a given phrase.</p></div><div class="section"><h3><a name="TooManyLines">TooManyLines</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="TooManyRecipients">TooManyRecipients</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="UserIs">UserIs</a></h3><p>Matches mail where the user is contained in a configurable list.</p></div></div><div class="section"><h2>Mailets<a name="Mailets"></a></h2><div class="section"><h3><a name="AbstractSign">AbstractSign</a></h3><p><P>Abstract mailet providing common SMIME signature services. +It can be subclassed to make authoring signing mailets simple. +By extending it and overriding one or more of the following methods a new behaviour can +be quickly created without the author having to address any issue other than +the relevant one:</P> +<ul> +<li>{@link #initDebug}, {@link #setDebug} and {@link #isDebug} manage the debugging mode.</li> +<li>{@link #initExplanationText}, {@link #setExplanationText} and {@link #getExplanationText} manage the text of +an attachment that will be added to explain the meaning of this server-side signature.</li> +<li>{@link #initKeyHolder}, {@link #setKeyHolder} and {@link #getKeyHolder} manage the {@link KeyHolder} object that will +contain the keys and certificates and will do the crypto work.</li> +<li>{@link #initPostmasterSigns}, {@link #setPostmasterSigns} and {@link #isPostmasterSigns} +determines whether messages originated by the Postmaster will be signed or not.</li> +<li>{@link #initRebuildFrom}, {@link #setRebuildFrom} and {@link #isRebuildFrom} +determines whether the "From:" header will be rebuilt to neutralize the wrong behaviour of +some MUAs like Microsoft Outlook Express.</li> +<li>{@link #initSignerName}, {@link #setSignerName} and {@link #getSignerName} manage the name +of the signer to be shown in the explanation text.</li> +<li>{@link #isOkToSign} controls whether the mail can be signed or not.</li> +<li>The abstract method {@link #getWrapperBodyPart} returns the massaged {@link javax.mail.internet.MimeBodyPart} +that will be signed, or null if the message has to be signed "as is".</li> +</ul> + +<P>Handles the following init parameters:</P> +<ul> +<li><keyHolderClass>: Sets the class of the KeyHolder object that will handle the cryptography functions, +for example org.apache.james.security.SMIMEKeyHolder for SMIME.</li> +<li><debug>: if <CODE>true</CODE> some useful information is logged. +The default is <CODE>false</CODE>.</li> +<li><keyStoreFileName>: the {@link java.security.KeyStore} full file name.</li> +<li><keyStorePassword>: the <CODE>KeyStore</CODE> 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.</li> +<li><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.</li> +<li><keyAliasPassword>: the alias password. The default is to use the <CODE>KeyStore</CODE> password. + At least one of the passwords must be provided.</li> +<li><keyStoreType>: the type of the keystore. The default will use {@link java.security.KeyStore#getDefaultType}.</li> +<li><postmasterSigns>: if <CODE>true</CODE> the message will be signed even if the sender is the Postmaster. +The default is <CODE>false</CODE>.</li></li> +<li><rebuildFrom>: If <CODE>true</CODE> will modify the "From:" header. +For more info see {@link #isRebuildFrom}. +The default is <CODE>false</CODE>.</li> +<li><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.</li> +<li><explanationText>: the text of an explanation of the meaning of this server-side signature. +May contain the following substitution patterns (see also {@link #getReplacedExplanationText}): +<CODE>[signerName]</CODE>, <CODE>[signerAddress]</CODE>, <CODE>[reversePath]</CODE>, <CODE>[headers]</CODE>. +It should be included in the signature. +The actual presentation of the text depends on the specific concrete mailet subclass: +see for example {@link SMIMESign}. +The default is to not have any explanation text.</li> +</ul></p></div><div class="section"><h3><a name="AddDeliveredToHeader">AddDeliveredToHeader</a></h3><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="AddFooter">AddFooter</a></h3><p>Mailet Info: <b>AddFooter Mailet</b><br /></p><p>Licensed to the Apache Software Foundation (ASF) under one * +or more contributor license agreements. See the NOTICE file * +distributed with this work for additional information * +regarding copyright ownership. The ASF licenses this file * +to you under the Apache License, Version 2.0 (the * +"License"); you may not use this file except in compliance * +with the License. You may obtain a copy of the License at * + * + http://www.apache.org/licenses/LICENSE-2.0 * + * +Unless required by applicable law or agreed to in writing, * +software distributed under the License is distributed on an * +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * +KIND, either express or implied. See the License for the * +specific language governing permissions and limitations * +under the License. *</p></div><div class="section"><h3><a name="AddHabeasWarrantMark">AddHabeasWarrantMark (Experimental)</a><a name="AddHabeasWarrantMark_Experimental"></a></h3><p>Mailet Info: <b>Add Habeas Warrant Mark. Must be used in accordance with a license from Habeas (see http://www.habeas.com for details).</b><br /></p><p><p>This matcher adds the Hebeas Warrant Mark to a message. +For details see: http://www.hebeas.com</p> + +<p> +Usage: +</p> + +<pre><code> +<mailet match="<suitable-matcher>" class="AddHabeasWarrantMark" /> +</code></pre> + +<p> +NOTE: 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. + +Because the Habeas Warrant Mark is copyright material, I have asked +for and received the following explicit statement from Habeas: +</p> +<pre> +----------------------------------- +From: Lindsey Pettit [mailto:supp...@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></p></div><div class="section"><h3><a name="AddSubjectPrefix">AddSubjectPrefix</a></h3><p>Mailet Info: <b>AddSubjectPrefix Mailet</b><br /></p><p>Add an prefix (tag) to the subject of a message <br> +<br> +<p/> +Sample Configuration: <br> +<pre><code> +<mailet match="RecipientIs=ro...@james.apache.org" class="TagMessage"> +<subjectPrefix>[robot]</subjectPrefix> </mailet> <br> +</code></pre></p></div><div class="section"><h3><a name="AmqpForwardAttribute">AmqpForwardAttribute</a></h3><p>Mailet Info: <b>AmqpForwardAttribute</b><br /></p><p>This mailet forwards the attributes values to a AMPQ. +<br /> +It takes 4 parameters: +<ul> +<li>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.</li> +<li>uri (mandatory): AMQP URI defining the server where to send the attachment.</li> +<li>exchange (mandatory): name of the AMQP exchange.</li> +<li>routing_key (optional, default to empty string): name of the routing key on this exchange.</li> +</ul> + +This mailet will extract the attachment content from the MimeBodyPart byte[] before +sending it.</p></div><div class="section"><h3><a name="BayesianAnalysis">BayesianAnalysis (Experimental)</a><a name="BayesianAnalysis_Experimental"></a></h3><p>Mailet Info: <b>BayesianAnalysis Mailet</b><br /></p><p><p> +Spam detection mailet using bayesian analysis techniques. +</p> + +<p> +Sets an email message header indicating the probability that an email message +is SPAM. +</p> + +<p> +Based upon the principals described in: <a +href="http://www.paulgraham.com/spam.html">A Plan For Spam</a> by Paul +Graham. Extended to Paul Grahams' <a +href="http://paulgraham.com/better.html">Better Bayesian Filtering</a>. +</p> + +<p> +The analysis capabilities are based on token frequencies (the <i>Corpus</i>) +learned through a training process (see {@link BayesianAnalysisFeeder}) and +stored in a JDBC database. After a training session, the Corpus must be +rebuilt from the database in order to acquire the new frequencies. Every 10 +minutes a special thread in this mailet will check if any change was made to +the database by the feeder, and rebuild the corpus if necessary. +</p> + +<p> +A <code>org.apache.james.spam.probability</code> mail attribute will be +created containing the computed spam probability as a +{@link java.lang.Double}. The <code>headerName</code> message header string +will be created containing such probability in floating point representation. +</p> + +<p> +Sample configuration: +</p> + +<pre> +<code> +<mailet match="All" class="BayesianAnalysis"> + <repositoryPath>db://maildb</repositoryPath> + <!-- + Set this to the header name to add with the spam probability + (default is "X-MessageIsSpamProbability"). + --> + <headerName>X-MessageIsSpamProbability</headerName> + <!-- + Set this to true if you want to ignore messages coming from local senders + (default is false). + By local sender we mean a return-path with a local server part (server listed + in <servernames> in config.xml). + --> + <ignoreLocalSender>true</ignoreLocalSender> + <!-- + Set this to the maximum message size (in bytes) that a message may have + to be considered spam (default is 100000). + --> + <maxSize>100000</maxSize> + <!-- + Set this to false if you not want to tag the message if spam is detected (Default is true). + --> + <tagSubject>true</tagSubject> +</mailet> +</code> +</pre> + +<p> +The probability of being spam is pre-pended to the subject if it is > 0.1 +(10%). +</p> + +<p> +The required tables are automatically created if not already there (see +sqlResources.xml). The token field in both the ham and spam tables is <b>case +sensitive</b>. +</p></p></div><div class="section"><h3><a name="BayesianAnalysisFeeder">BayesianAnalysisFeeder (Experimental)</a><a name="BayesianAnalysisFeeder_Experimental"></a></h3><p>Mailet Info: <b>BayesianAnalysisFeeder Mailet</b><br /></p><p><p> +Feeds ham OR spam messages to train the {@link BayesianAnalysis} mailet. +</p> + +<p> +The new token frequencies will be stored in a JDBC database. +</p> + +<p> +Sample configuration: +</p> + +<pre> +<code> +<processor name="root"> + + <mailet match="RecipientIs=not.s...@thisdomain.com" class="BayesianAnalysisFeeder"> + <repositoryPath> db://maildb </repositoryPath> + <feedType>ham</feedType> + <!-- + Set this to the maximum message size (in bytes) that a message may have + to be analyzed (default is 100000). + --> + <maxSize>100000</maxSize> + </mailet> + + <mailet match="RecipientIs=s...@thisdomain.com" class="BayesianAnalysisFeeder"> + <repositoryPath> db://maildb </repositoryPath> + <feedType>spam</feedType> + <!-- + Set this to the maximum message size (in bytes) that a message may have + to be analyzed (default is 100000). + --> + <maxSize>100000</maxSize> + </mailet> + +<processor> +</code> +</pre> + +<p> +The previous example will allow the user to send messages to the server and +use the recipient email address as the indicator for whether the message is +ham or spam. +</p> + +<p> +Using the example above, send good messages (ham not spam) to the email +address "not.s...@thisdomain.com" to pump good messages into the feeder, and +send spam messages (spam not ham) to the email address "s...@thisdomain.com" +to pump spam messages into the feeder. +</p> + +<p> +The bayesian database tables will be updated during the training reflecting +the new data +</p> + +<p> +At the end the mail will be destroyed (ghosted). +</p> + +<p> +<b>The correct approach is to send the original ham/spam message as an +attachment to another message sent to the feeder; all the headers of the +enveloping message will be removed and only the original message's tokens +will be analyzed.</b> +</p> + +<p> +After a training session, the frequency <i>Corpus</i> used by +<code>BayesianAnalysis</code> must be rebuilt from the database, in order to +take advantage of the new token frequencies. Every 10 minutes a special +thread in the <code>BayesianAnalysis</code> mailet will check if any change +was made to the database, and rebuild the corpus if necessary. +</p> + +<p> +Only one message at a time is scanned (the database update activity is +<i>synchronized</i>) in order to avoid too much database locking, as +thousands of rows may be updated just for one message fed. +</p></p></div><div class="section"><h3><a name="ClamAVScan">ClamAVScan (Experimental)</a><a name="ClamAVScan_Experimental"></a></h3><p>Mailet Info: <b>Antivirus Check using ClamAV (CLAMD)</b><br /></p><p><P>Does an antivirus scan check using a ClamAV daemon (CLAMD)</P> +<p/> +<P> Interacts directly with the daemon using the "stream" method, +which should have the lowest possible overhead.</P> +<P>The CLAMD daemon will typically reside on <I>localhost</I>, 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> +<p/> +<P>Handles the following init parameters:</P> +<UL> +<LI><CODE><debug></CODE>.</LI> +<LI><CODE><host></CODE>: the host name of the server where CLAMD runs. It can either be +a machine name, such as +"<code>java.sun.com</code>", 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, <I>round-robin load sharing</I> will +be used. +The default is <CODE>localhost</CODE>.</LI> +<LI><CODE><port></CODE>: the port on which CLAMD listens. The default is <I>3310</I>.</LI> +<LI><CODE><maxPings></CODE>: the maximum number of connection retries during startup. +If the value is <I>0</I> no startup test will be done. +The default is <I>6</I>.</LI> +<LI><CODE><pingIntervalMilli></CODE>: the interval (in milliseconds) +between each connection retry during startup. +The default is <I>30000</I> (30 seconds).</LI> +<LI><CODE><streamBufferSize></CODE>: the BufferedOutputStream buffer size to use +writing to the <I>stream connection</I>. The default is <I>8192</I>.</LI> +</UL> +<p/> +<P>The actions performed are as follows:</P> +<UL> +<LI>During initialization:</LI> +<OL> +<LI>Gets all <CODE>config.xml</CODE> parameters, handling the defaults;</LI> +<LI>resolves the <CODE><host></CODE> parameter, creating the round-robin IP list;</LI> +<LI>connects to CLAMD at the first IP in the round-robin list, on +the specified <CODE><port></CODE>;</LI> +<LI>if unsuccessful, retries every <CODE><pingIntervalMilli></CODE> milliseconds up to +<CODE><maxPings></CODE> times;</LI> +<LI>sends a <CODE>PING</CODE> request;</LI> +<LI>waits for a <CODE>PONG</CODE> answer;</LI> +<LI>repeats steps 3-6 for every other IP resolved. +</OL> +<LI>For every mail</LI> +<OL> +<LI>connects to CLAMD at the "next" IP in the round-robin list, on +the specified <CODE><port></CODE>, 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;</LI> +<LI>sends a "<CODE>STREAM</CODE>" request;</LI> +<LI>parses the "<CODE>PORT <I>streamPort</I></CODE>" answer obtaining the port number;</LI> +<LI>makes a second connection (the <I>stream connection</I>) to CLAMD at the same host (or IP) +on the <I>streamPort</I> just obtained;</LI> +<LI>sends the mime message to CLAMD (using {@link MimeMessage#writeTo(java.io.OutputStream)}) +through the <I>stream connection</I>;</LI> +<LI>closes the <I>stream connection</I>;</LI> +<LI>gets the "<CODE>OK</CODE>" or "<CODE>... FOUND</CODE>" answer from the main connection;</LI> +<LI>closes the main connection;</LI> +<LI>sets the "<CODE>org.apache.james.infected</CODE>" <I>mail attribute</I> to either +"<CODE>true</CODE>" or "<CODE>false</CODE>";</LI> +<LI>adds the "<CODE>X-MessageIsInfected</CODE>" <I>header</I> to either +"<CODE>true</CODE>" or "<CODE>false</CODE>";</LI> +</OL> +</UL> +<p/> +<P>Some notes regarding <a href="http://www.clamav.net/">clamav.conf</a>:</p> +<UL> +<LI><CODE>LocalSocket</CODE> must be commented out</LI> +<LI><CODE>TCPSocket</CODE> must be set to a port# (typically 3310)</LI> +<LI><CODE>StreamMaxLength</CODE> must be >= the James config.xml parameter +<<CODE>maxmessagesize</CODE>> in SMTP <<CODE>handler</CODE>></LI> +<LI><CODE>MaxThreads</CODE> should? be >= the James config.xml parameter +<<CODE>threads</CODE>> in <<CODE>spoolmanager</CODE>></LI> +<LI><CODE>ScanMail</CODE> must be uncommented</LI> +</UL> +<p/> +<P>Here follows an example of config.xml definitions deploying CLAMD on localhost, +and handling the infected messages:</P> +<PRE><CODE> +<p/> +... +<p/> +<!-- Do an antivirus scan --> +<mailet match="All" class="ClamAVScan" onMailetException="ignore"/> +<p/> +<!-- If infected go to virus processor --> +<mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor"> +<processor> virus </processor> +</mailet> +<p/> +<!-- 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> +<p/> +... +<p/> +<!-- Messages containing viruses --> +<processor name="virus"> +<p/> +<!-- To avoid a loop while bouncing --> +<mailet match="All" class="SetMailAttribute"> +<org.apache.james.infected>true, bouncing</org.apache.james.infected> +</mailet> +<p/> +<mailet match="SMTPAuthSuccessful" class="Bounce"> +<sender>bounce-ad...@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> +<p/> +<!-- +<mailet match="All" class="ToRepository"> +<repositoryPath>file://var/mail/infected/</repositoryPath> +</mailet> +--> +<p/> +<mailet match="All" class="Null" /> +</processor> +</CODE></PRE></p></div><div class="section"><h3><a name="ClassifyBounce">ClassifyBounce (Experimental)</a><a name="ClassifyBounce_Experimental"></a></h3><p>Mailet Info: <b>SetMimeHeader Mailet</b><br /></p><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/> +Sample configuration: +<p/> +<mailet match="All" class="ClassifyBounce"> +<headerName>X-MailetHeader</headerName> +</mailet></p></div><div class="section"><h3><a name="Counter">Counter</a></h3><p>Mailet Info: <b>Counter Mailet</b><br /></p><p>A simple in memory counter. Designed to count messages sent to this recipient +for debugging purposes.</p></div><div class="section"><h3><a name="DumpSystemErr">DumpSystemErr</a></h3><p>Mailet Info: <b>Dumps message to System.err</b><br /></p><p>Debugging purpose Mailet. Sends the message to System.err</p></div><div class="section"><h3><a name="ExceptionThrowingMailet">ExceptionThrowingMailet</a></h3><p>Mailet Info: <b>ExceptionThrowingMailet Mailet</b><br /></p><p>Debugging purpose Mailet. Just throws an exception.</p></div><div class="section"><h3><a name="GenericMailet">GenericMailet</a></h3><p>GenericMailet makes writing mailets easier. It provides simple +versions of the lifecycle methods init and destroy and of the methods +in the MailetConfig interface. GenericMailet also implements the log +method, declared in the MailetContext interface. +<p> +To write a generic mailet, you need only override the abstract service +method.</p></div><div class="section"><h3><a name="HeadersToHTTP">HeadersToHTTP (Experimental)</a><a name="HeadersToHTTP_Experimental"></a></h3><p>Mailet Info: <b>HTTP POST serialised message</b><br /></p><p>Serialise the email and pass it to an HTTP call + +Sample configuration: + +<mailet match="All" class="HeadersToHTTP"> +<url>http://192.168.0.252:3000/alarm</url> +<parameterKey>Test</parameterKey> +<parameterValue>ParameterValue</parameterValue> +<passThrough>true</passThrough> +</mailet></p></div><div class="section"><h3><a name="ICALToHeader">ICALToHeader</a></h3><p>Mailet Info: <b>ICALToHeader Mailet</b><br /></p><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. + +The following headers will be added : X_MEETING_UID, X_MEETING_METHOD, X_MEETING_RECURRENCE_ID, X_MEETING_SEQUENCE, +X_MEETING_DTSTAMP + +The only configuration parameter for this mailet is the attribute the ICAL4J Calendar map should be attached to, +named <b>attribute</b>. + +Configuration example : + +<pre> + <code> + <mailet matcher=??? class=ICALToHeader> + <attribute>icalendars</attribute> + </mailet> + </code> +</pre></p></div><div class="section"><h3><a name="ICALToJsonAttribute">ICALToJsonAttribute</a></h3><p>Mailet Info: <b>ICALToJson Mailet</b><br /></p><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. + +The JSON contains the following fields : + +<ul> + <li><b>ical</b> : the raw ical string, in UTF-8</li> + <li><b>sender</b> : the sender of the mail (compulsory, mail without sender will be discarded)</li> + <li><b>recipient</b> : the recipient of the mail. If the mail have several recipients, each recipient will have + its own JSON.</li> + <li><b>uid</b> : the UID of the ical (optional)</li> + <li><b>sequence</b> : the sequence of the ical (optional)</li> + <li><b>dtstamp</b> : the date stamp of the ical (optional)</li> + <li><b>method</b> : the method of the ical (optional)</li> + <li><b>recurrence-id</b> : the recurrence-id of the ical (optional)</li> +</ul> + +Example are included in test call ICalToJsonAttributeTest. + + Configuration example : + +<pre> + <code> + <mailet matcher=??? class=ICALToJsonAttribute> + <sourceAttribute>icalendars</sourceAttribute> + <destinationAttribute>icalendarJson</destinationAttribute> + </mailet> + </code> +</pre></p></div><div class="section"><h3><a name="ICalendarParser">ICalendarParser</a></h3><p>Mailet Info: <b>Calendar Parser</b><br /></p><p><p> +This mailet can be combined with the Strip attachment mailet. +</p> +<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> +<p> +Configuration: The mailet contains 2 mandatory attributes +</p> +<p> + +<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> + +</p></p></div><div class="section"><h3><a name="Identity">Identity</a></h3><p>Mailet Info: <b>Identity Mailet</b><br /></p><p>Opposite of Null Mailet. It let any incoming mail untouched. Used only for +debugging.</p></div><div class="section"><h3><a name="LogMessage">LogMessage</a></h3><p>Mailet Info: <b>LogHeaders Mailet</b><br /></p><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 class="section"><h3><a name="MailAttributesToMimeHeaders">MailAttributesToMimeHeaders</a></h3><p><p>Convert attributes to headers</p> + +<p>Sample configuration:</p> +<pre><code> +<mailet match="All" class="MailAttributesToMimeHeaders"> +<simplemapping>org.apache.james.attribute1; +headerName1</simplemapping> +<simplemapping>org.apache.james.attribute2; +headerName2</simplemapping> </mailet> +</code></pre></p></div><div class="section"><h3><a name="MimeDecodingMailet">MimeDecodingMailet</a></h3><p>Mailet Info: <b>MimeDecodingMailet</b><br /></p><p>This mailet replace the mail attribute map of key to MimePart +by a map of key to the MimePart content (as bytes). +<br /> +It takes only one parameter: +<ul> +<li>attribute (mandatory): mime content to be decoded, expected to be a Map<String, byte[]> +</ul> + +Then all this map attribute values will be replaced by their content.</p></div><div class="section"><h3><a name="Null">Null</a></h3><p>Mailet Info: <b>Null Mailet</b><br /></p><p>Simplest Mailet which destroys any incoming messages +by setting their state to GHOST</p></div><div class="section"><h3><a name="OnlyText">OnlyText (Experimental)</a><a name="OnlyText_Experimental"></a></h3><p>Mailet Info: <b>OnlyText</b><br /></p><p>Keep only the text part of a message. +<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.<br> +- text/plain<br> +- text/html => with a conversion to text only<br> +- text/* as is.</p></p></div><div class="section"><h3><a name="PostmasterAlias">PostmasterAlias</a></h3><p>Mailet Info: <b>Postmaster aliasing mailet</b><br /></p><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 class="section"><h3><a name="RecipientToLowerCase">RecipientToLowerCase</a></h3><p>{@link GenericMailet} which convert all Recipients to lowercase</p></div><div class="section"><h3><a name="RecoverAttachment">RecoverAttachment (Experimental)</a><a name="RecoverAttachment_Experimental"></a></h3><p>Mailet Info: <b>RecoverAttachment Mailet</b><br /></p><p><p> +This mailet takes an attachment stored in an attribute and attach it back to +the message +</p> +<p> +This may be used to place back attachment stripped by StripAttachment and +stored in the attribute +<code>org.apache.james.mailet.standard.mailets.StripAttachment.saved</code> +</p> +<p> + +<pre> + <mailet match="All" class="RecoverAttachment" > + <attribute>my.attribute.name</attribute> + </mailet > +</pre> + +</p></p></div><div class="section"><h3><a name="RemoveAllMailAttributes">RemoveAllMailAttributes</a></h3><p>Mailet Info: <b>Remove All Mail Attributes Mailet</b><br /></p><p>This mailet sets removes all attributes set on the Mail instance + +Sample configuration: +<pre><code> +<mailet match="All" class="RemoveAllMailAttributes"/> +</code></pre></p></div><div class="section"><h3><a name="RemoveMailAttribute">RemoveMailAttribute</a></h3><p>Mailet Info: <b>Remove Mail Attribute Mailet</b><br /></p><p>This mailet sets attributes on the Mail. + +Sample configuration: +<pre><code> +<mailet match="All" class="RemoveMailAttribute"> + <name>attribute_name1</name> + <name>attribute_name2</name> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="RemoveMimeHeader">RemoveMimeHeader</a></h3><p>Mailet Info: <b>RemoveMimeHeader Mailet</b><br /></p><p>Remove mime headers + +Sample configuration: + +<pre><code> +<mailet match="All" class="RemoveMimeHeader"> +<name>header1</name> +<name>header2</name> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="ReplaceContent">ReplaceContent</a></h3><p>Mailet Info: <b>ReplaceContent</b><br /></p><p>Replace text contents +<p>This mailet allow to specific regular expression to replace text in subject and content. + +<p> +Each expression is defined as: +<code>/REGEX_PATTERN/SUBSTITUTION_PATTERN/FLAGS/</code> +</p> + +<p> +<code>REGEX_PATTERN</code> is a regex used for the match<br> +<code>SUBSTITUTION_PATTERN</code> is a substitution pattern<br> +<code>FLAGS</code> flags supported for the pattern:<br> + i: case insensitive<br> + m: multi line<br> + x: extended (N/A)<br> + r: repeat - keep matching until a substitution is possible<br> +</p> + +<p>To identify subject and body pattern we use the tags <subjectPattern> and <bodyPattern></p> + +<p> +Rules can be specified in external files. +Lines must be CRLF terminated and lines starting with # are considered commments. +Tags used to include external files are <subjectPatternFile> and +<bodyPatternFile> +If file path starts with # then the file is loaded as a reasource. +</p> + +<p> +Use of both files and direct patterns at the same time is allowed. +</p> + +<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> + +<p> +NOTE: +Regexp rules must be escaped by regexp excaping rules and applying this 2 additional rules:<br> +- "/" char inside an expression must be prefixed with "\": + e.g: "/\//-//" replaces "/" with "-"<br> +- 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.<br> +</p></p></div><div class="section"><h3><a name="SMIMECheckSignature">SMIMECheckSignature</a></h3><p><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> +<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 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> +<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 <code>mailAttribute</code>). 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> +<p> +Optionally, specifying the parameter <code>strip</code>, 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> +<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. +<ul> +<li>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. +<li>keyStoreFileName (default: JAVA_HOME/jre/lib/security/cacert): Certificate +store path. +<li>keyStorePassword (default: ""): Certificate store password. +</ul> +Other parameters configure the behavior of the mailet: +<ul> +<li>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. +<li>mailAttribute (default: org.apache.james.SMIMECheckSignature): +specifies in which attribute the check results will be written. +<li>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. +</ul> +</p></p></div><div class="section"><h3><a name="SMIMEDecrypt">SMIMEDecrypt</a></h3><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 +<code>org.apache.james.SMIMEDecrypt</code> will contain the public +certificate of the key used in the process. + +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. +<ul> +<li>keyStoreType (default: system dependent): defines the type of the store. +Usually jks, pkcs12 or pkcs7</li> +<li>keyStoreFileName (mandatory): private key store path.</li> +<li>keyStorePassword (default: ""): private key store password</li> +</ul> +The other parameters define which private key have to be used. (if the store +contains more than one key). +<ul> +<li>keyAlias: private key alias.</li> +<li>keyPass: private key password</li> +</ul></p></div><div class="section"><h3><a name="SMIMESign">SMIMESign</a></h3><p>Mailet Info: <b>SMIME Signature Mailet</b><br /></p><p><p>Puts a <I>server-side</I> SMIME signature on a message. +It is a concrete subclass of {@link Sign}, with very few modifications to it, +to specialize for SMIME.</p> + + <P>Handles the following init parameters (will comment only the differences from {@link AbstractSign}):</P> +<ul> +<li><debug>.</li> +<li><keyStoreFileName>.</li> +<li><keyStorePassword>.</li> +<li><keyAlias>.</li> +<li><keyAliasPassword>.</li> +<li><keyStoreType>.</li> +<li><postmasterSigns>. The default is <CODE>true</CODE>.</li> +<li><rebuildFrom>. The default is <CODE>true</CODE>.</li> +<li><signerName>.</li> +<li><explanationText>. There is a default explanation string template in English, +displaying also all the headers of the original message (see {@link #getExplanationText}).</li> +</ul></p></div><div class="section"><h3><a name="SerialiseToHTTP">SerialiseToHTTP (Experimental)</a><a name="SerialiseToHTTP_Experimental"></a></h3><p>Mailet Info: <b>HTTP POST serialised message</b><br /></p><p>Serialise the email and pass it to an HTTP call + +Sample configuration: + +<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></p></div><div class="section"><h3><a name="ServerTime">ServerTime (Experimental)</a><a name="ServerTime_Experimental"></a></h3><p>Mailet Info: <b>ServerTime Mailet</b><br /></p><p>Returns the current time for the mail server. Sample configuration: +<pre><code> +<mailet match="RecipientIs=t...@cadenza.lokitech.com" class="ServerTime"> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="SetMailAttribute">SetMailAttribute</a></h3><p>Mailet Info: <b>Set Mail Attribute Mailet</b><br /></p><p><p>This mailet sets attributes on the Mail.</p> + +<p>Sample configuration:</p> +<pre><code> +<mailet match="All" class="SetMailAttribute"> + <name1>value1</name1> + <name2>value2</name2> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="SetMimeHeader">SetMimeHeader</a></h3><p>Mailet Info: <b>SetMimeHeader Mailet</b><br /></p><p><p>Adds a specified header and value to the message.</p> + +<p>Sample configuration:</p> + +<pre><code> +<mailet match="All" class="AddHeader"> + <name>X-MailetHeader</name> + <value>TheHeaderValue</value> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="Sign">Sign</a></h3><p>Mailet Info: <b>Signature Mailet</b><br /></p><p><p>Puts a <I>server-side</I> signature on a message. +It is a concrete subclass of {@link AbstractSign}, with very few modifications to it.</p> +<p>A text file with an explanation text is attached to the original message, +and the resulting message with all its attachments is signed. +The resulting appearence of the message is almost unchanged: only an extra attachment +and the signature are added.</p> +<p>The kind of signuture depends on the value of the <keyHolderClass> init parameter. + + <P>Handles the following init parameters (will comment only the differences from {@link AbstractSign}):</P> +<ul> +<li><keyHolderClass>: Sets the class of the KeyHolder object that will handle the cryptography functions, +for example org.apache.james.security.SMIMEKeyHolder for SMIME.</li> +<li><debug>.</li> +<li><keyStoreFileName>.</li> +<li><keyStorePassword>.</li> +<li><keyAlias>.</li> +<li><keyAliasPassword>.</li> +<li><keyStoreType>.</li> +<li><postmasterSigns>. The default is <CODE>true</CODE>.</li> +<li><rebuildFrom>. The default is <CODE>true</CODE>.</li> +<li><signerName>.</li> +<li><explanationText>. There is a default explanation string template in English, +displaying also all the headers of the original message (see {@link #getExplanationText}).</li> +</ul></p></div><div class="section"><h3><a name="StripAttachment">StripAttachment</a></h3><p>Mailet Info: <b>StripAttachment</b><br /></p><p><p> +Remove attachments from a Message. Supports simple removal, storing to file, +or storing to mail attributes. +</p> +<p> +Configuration: +</p> +<p> + +<pre> + <mailet match="All" class="StripAttachment" > + <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 "no", "matched", "all" -- > + <!-- attribute>my.attribute.name</attribute --> + </mailet > + + At least one of pattern, notpattern and mimeType is required. +</pre> + +</p></p></div><div class="section"><h3><a name="ToProcessor">ToProcessor</a></h3><p>Mailet Info: <b>ToProcessor Mailet</b><br /></p><p><p>This mailet redirects the mail to the named processor</p> + +<p>Sample configuration:</p> +<pre><code +> +<mailet match="All" class="ToProcessor"> + <processor>spam</processor> + <notice>Notice attached to the message (optional)</notice> +</mailet> +</code></pre></p></div><div class="section"><h3><a name="UnwrapText">UnwrapText (Experimental)</a><a name="UnwrapText_Experimental"></a></h3><p>Mailet Info: <b>UnwrapText</b><br /></p><p><p>Remove (best effort to) the hardcoded wrapping from a message.<br> +If the text is "format=flowed" then deflows the text. Otherwise it forces a dewrap of the text. +</p> +<p>Parameters:<br> +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.<br> +The value should be "WIDTH+X" if the original length is known, "-X" otherwise. +In the latter case the length of the longer line will be used. +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> + +<p> +In summary, if the original wrap is known (for example 76, for flowed messages)<br> + <code>quotewidth = 78</code><br> +Otherwise<br> + <code>quotewidth = -10</code> +</p></p></div><div class="section"><h3><a name="UseHeaderRecipients">UseHeaderRecipients (Experimental)</a><a name="UseHeaderRecipients_Experimental"></a></h3><p>Mailet Info: <b>UseHeaderRecipients Mailet</b><br /></p><p><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> +<p/> +<p>To use this, match against the redirection address using the +<code>RecipientIs</code> matcher and set the mailet 'class' to +<code>UseHeaderRecipients</code>. 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> +<p/> +<p>e.g.</p> +<pre><code> + <mailet match="RecipientIs=forwarded@myhost" + class="UseHeaderRecipients"> + </mailet> +</code></pre></p></div><div class="section"><h3><a name="WrapText">WrapText (Experimental)</a><a name="WrapText_Experimental"></a></h3><p>Mailet Info: <b>WrapText</b><br /></p><p>Convert a message to format=flowed</p></div></div> + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + Copyright © All Rights Reserved. + + </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html>
--------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org