http://git-wip-us.apache.org/repos/asf/james-site/blob/4c2da3c0/content/server/dev-provided-mailets.html ---------------------------------------------------------------------- diff --git a/content/server/dev-provided-mailets.html b/content/server/dev-provided-mailets.html index 921e222..4400388 100644 --- a/content/server/dev-provided-mailets.html +++ b/content/server/dev-provided-mailets.html @@ -67,7 +67,7 @@ <a href="http://www.apache.org/index.html" id="bannerRight"> - <img src="images/logos/asf_logo_small.png" alt="The Apache Software Foundation" /> + <img src="../images/logos/asf_logo_small.png" alt="The Apache Software Foundation" /> </a> <div class="clear"> <hr/> @@ -265,701 +265,2524 @@ <div class="section"> -<h2>Mailets<a name="Mailets"></a></h2> + <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="#AbstractNetworkMatcher">AbstractNetworkMatcher</a></li><li><a href="#AbstractQuotaMatcher">AbstractQuotaMatcher (Experimental)</a></li><li><a +href="#AbstractSQLWhitelistMatcher">AbstractSQLWhitelistMatcher (Experimental)</a></li><li><a href="#AbstractStorageQuota">AbstractStorageQuota (Experimental)</a></li><li><a +href="#All">All</a></li><li><a href="#And">And</a></li><li><a href="#AnotherMatcher">AnotherMatcher</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="#CompositeMatcher">CompositeMatcher</a></li><li><a href="#CustomMatcher">CustomMatcher</a></li><li><a +href="#FetchedFrom">FetchedFrom</a></li><li><a href="#FileRegexMatcher">FileRegexMatcher (Experimental)</a></li><li><a href="#GenericCompositeMatcher">GenericCompositeMatcher</a></li><li><a +href="#GenericMatcher">GenericMatcher</a></li><li><a href="#GenericRecipientMatcher">GenericRecipientMatcher</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="#InSpammerBlacklist">InSpammerBlacklist (Experimental)</a></li><li><a href="#IsInWhiteList">IsInWhiteList (Experimental)</a></li><li><a href="#IsOverQuota">IsOverQuota</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="#MailboxQuotaFixed">MailboxQuotaFixed (Experimental)</a></li><li><a href="#MatcherInverter">MatcherInverter</a></li><li><a +href="#NESSpamCheck">NESSpamCheck (Experimental)</a></li><li><a href="#NetworkIsInWhitelist">NetworkIsInWhitelist (Experimental)</a></li><li><a href="#Not">Not</a></li><li><a href="#Or">Or</a></li><li><a +href="#RecipientIs">RecipientIs</a></li><li><a href="#RecipientIsLocal">RecipientIsLocal</a></li><li><a href="#RecipientIsRegex">RecipientIsRegex</a></li><li><a +href="#RelayLimit">RelayLimit</a></li><li><a href="#RemoteAddrInNetwork">RemoteAddrInNetwork</a></li><li><a href="#RemoteAddrNotInNetwork">RemoteAddrNotInNetwork</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="#SenderInFakeDomain">SenderInFakeDomain (Experimental)</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><li><a +href="#Xor">Xor</a></li></ul></div></td><td><div class="section"><h3>Mailets<a name="Mailets"></a></h3><ul><li><a href="#AbstractRecipientRewriteTable">AbstractRecipientRewriteTable +(Experimental)</a></li><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="#AnotherMailet">AnotherMailet</a></li><li><a href="#BayesianAnalysis">BayesianAnalysis (Experimental)</a></li><li><a href="#BayesianAnalysis">BayesianAnalysis (Experimental)</a></li><li><a +href="#BayesianAnalysisFeeder">BayesianAnalysisFeeder (Experimental)</a></li><li><a href="#BayesianAnalysisFeeder">BayesianAnalysisFeeder (Experimental)</a></li><li><a +href="#Bounce">Bounce</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="#CustomMailet">CustomMailet</a></li><li><a href="#DSNBounce">DSNBounce</a></li><li><a href="#DumpSystemErr">DumpSystemErr</a></li><li><a +href="#ExceptionThrowingMailet">ExceptionThrowingMailet</a></li><li><a href="#Forward">Forward</a></li><li><a href="#FromRepository">FromRepository (Experimental)</a></li><li><a +href="#GenericMailet">GenericMailet</a></li><li><a href="#HeadersToHTTP">HeadersToHTTP (Experimental)</a></li><li><a href="#ICALToHeader">ICALToHeader</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="#JDBCAlias">JDBCAlias +(Experimental)</a></li><li><a href="#JDBCRecipientRewriteTable">JDBCRecipientRewriteTable (Experimental)</a></li><li><a href="#LocalDelivery">LocalDelivery</a></li><li><a +href="#LogMessage">LogMessage</a></li><li><a href="#MailAttributesToMimeHeaders">MailAttributesToMimeHeaders</a></li><li><a href="#ManageSieveMailet">ManageSieveMailet (Experimental)</a></li><li><a +href="#MetricsMailet">MetricsMailet</a></li><li><a href="#MimeDecodingMailet">MimeDecodingMailet</a></li><li><a href="#NotifyPostmaster">NotifyPostmaster</a></li><li><a +href="#NotifySender">NotifySender</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="#RecipientRewriteTable">RecipientRewriteTable</a></li><li><a href="#RecipientToLowerCase">RecipientToLowerCase</a></li><li><a href="#RecoverAttachment">RecoverAttachment +(Experimental)</a></li><li><a href="#Redirect">Redirect</a></li><li><a href="#RedirectNotify">RedirectNotify</a></li><li><a href="#RemoteDelivery">RemoteDelivery</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="#Resend">Resend</a></li><li><a href="#SMIMECheckSignature">SMIMECheckSignature</a></li><li><a href="#SMIMEDecrypt">SMIMEDecrypt</a></li><li><a +href="#SMIMESign">SMIMESign</a></li><li><a href="#SPF">SPF (Experimental)</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="#Sieve">Sieve</a></li><li><a +href="#Sign">Sign</a></li><li><a href="#SpamAssassin">SpamAssassin (Experimental)</a></li><li><a href="#StripAttachment">StripAttachment</a></li><li><a +href="#TerminatingMailet">TerminatingMailet</a></li><li><a href="#ToProcessor">ToProcessor</a></li><li><a href="#ToRecipientFolder">ToRecipientFolder</a></li><li><a +href="#ToRepository">ToRepository</a></li><li><a href="#ToSenderFolder">ToSenderFolder (Experimental)</a></li><li><a href="#UnwrapText">UnwrapText (Experimental)</a></li><li><a +href="#UseHeaderRecipients">UseHeaderRecipients (Experimental)</a></li><li><a href="#UsersRepositoryAliasingForwarding">UsersRepositoryAliasingForwarding (Experimental)</a></li><li><a +href="#WhiteListManager">WhiteListManager (Experimental)</a></li><li><a href="#WrapText">WrapText (Experimental)</a></li><li><a href="#XMLRecipientRewriteTable">XMLRecipientRewriteTable +(Experimental)</a></li></ul></div></td></tr></table><div class="section"><h2>Matchers<a name="Matchers"></a></h2><div class="section"><h3><a +name="AbstractNetworkMatcher">AbstractNetworkMatcher</a></h3><p><p> +AbstractNetworkMatcher makes writing IP Address matchers easier. +</p> +<p> +This class extends the GenericMatcher, and as such, has access to the matcher +condition via GenericMatcher.getCondition().<br> +On initialization, the init method retrieves the condition from the defined +matcher and create a corresponding NetMatcher.<br> +The marcher condition has to respect the syntax waited by the NetMacher. +</p> +<p> +This abstract network matcher needs to be implemented by a concrete class.<br> +The implementing concrete class will call the matchNetwork method. +</p></p></div><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="AbstractSQLWhitelistMatcher">AbstractSQLWhitelistMatcher (Experimental)</a><a +name="AbstractSQLWhitelistMatcher_Experimental"></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="AbstractStorageQuota">AbstractStorageQuota (Experimental)</a><a +name="AbstractStorageQuota_Experimental"></a></h3><p><p> +Experimental: Abstract matcher checking whether a recipient has exceeded a +maximum allowed <I>storage</I> quota for messages standing in his inbox. +</p> +<p> +"Storage quota" at this level is still an abstraction whose specific +interpretation will be done by subclasses (e.g. could be specific for each +user or common to all of them). +</p> +<p> +This matcher need to calculate the mailbox size every time it is called. This +can slow down things if there are many mails in the mailbox. Some users also +report big problems with the matcher if a JDBC based mailrepository is used. +</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="And">And</a></h3><p>This matcher performs And conjunction between the two +recipients</p></div><div class="section"><h3><a name="AnotherMatcher">AnotherMatcher</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="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 [email protected], this matcher will return true +for [email protected] and [email protected].</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="CompositeMatcher">CompositeMatcher</a></h3><p>A CompositeMatcher contains child matchers that are invoked in turn and their +recipient results are composed from the composite operation. See And, Or, Xor +and Not. One or more children may be supplied to a composite via declaration +inside a processor in the james-config.xml file. When the composite is the +outter-most declaration it must be named, as in the example below. The +composite matcher may be referenced by name and used in a subsequent mailet. +Any matcher may be included as a child of a composite matcher, including +another composite matcher or the Not matcher. As a consequence, the class +names: And, Or, Not and Xor are permanently reserved. +<pre> + <matcher name="a-composite" match="Or"> + <matcher match="And"> + <matcher match="Not"> + <matcher match="HostIs=65.55.116.84"/> + </matcher> + <matcher match="HasHeaderWithRegex=X-Verify-SMTP,Host(.*)sending to us was not listening"/> + </matcher> + <matchwe match="HasHeaderWithRegex=X-DNS-Paranoid,(.*)"/> + </matcher> + + <mailet match="a-composite" class="ToProcessor"> + <processor>spam</processor> + </mailet> +* +</pre></p></div><div class="section"><h3><a name="CustomMatcher">CustomMatcher</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="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="GenericCompositeMatcher">GenericCompositeMatcher</a></h3><p>Abstract base class for CompositeMatchers. This class handles the child +collection of Matchers associated with the CompositeMatcher.</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>James provides a number of implemented Mailets for use by James administrators in their -configurations. These are primarily mailets that members of the James developer or user -communities have found useful in their own configurations. A description of how to configure -Mailets and use them in the James SpoolManager can be found <a href="config-mailetcontainer.html">here</a>.</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:[email protected]] +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> -<div class="section"> -<h3>AddFooter<a name="AddFooter"></a></h3> +<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="InSpammerBlacklist">InSpammerBlacklist (Experimental)</a><a name="InSpammerBlacklist_Experimental"></a></h3><p>Checks the network IP address of the sending +server against a blacklist of +spammers. There are 3 lists that support this... +<ul> +<li><b>blackholes.mail-abuse.org</b>: Rejected - see +http://www.mail-abuse.org/rbl/ +<li><b>dialups.mail-abuse.org</b>: Dialup - see +http://www.mail-abuse.org/dul/ +<li><b>relays.mail-abuse.org</b>: Open spam relay - see +http://www.mail-abuse.org/rss/ +</ul> -<p>Description: This mailet adds a text footer to the message.</p> +Example: +<pre> +<mailet match="InSpammerBlacklist=blackholes.mail-abuse.org." class="ToProcessor"> + <processor>spam</processor> +</mailet> +</pre></p></div><div class="section"><h3><a name="IsInWhiteList">IsInWhiteList (Experimental)</a><a name="IsInWhiteList_Experimental"></a></h3><p><p> +Matches recipients having the mail sender in the recipient's private +whitelist . +</p> +<p> +The recipient name is always converted to its primary name (handling +aliases). +</p> +<p> +Configuration string: The database name containing the white list table. +</p> +<p> +Example: -<p>Parameters: +<pre> + <mailet match="IsInWhiteList=db://maildb" class="ToProcessor"> + <processor> transport </processor> + </mailet> +</pre> + +</p></p></div><div class="section"><h3><a name="IsOverQuota">IsOverQuota</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="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><b>text</b> (required) - the text that will be added as a footer to the message.</li> +<li>mailAttribute;string</li> +</ul></p></div><div class="section"><h3><a name="MailboxQuotaFixed">MailboxQuotaFixed (Experimental)</a><a name="MailboxQuotaFixed_Experimental"></a></h3><p>Matcher which can be used to set a quota for +users Mailbox. This +{@link Matcher} need to recalculate the used space of users mailbox on every +call. So use it with caution!</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="NetworkIsInWhitelist">NetworkIsInWhitelist (Experimental)</a><a name="NetworkIsInWhitelist_Experimental"></a></h3><p><p> +Matcher which lookup whitelisted networks in a database. The networks can be +specified via netmask. +</p> +<p> +For example: <code>192.168.0.0/24</code> +</p> +<p> +Th whitelisting is done per recipient +</p></p></div><div class="section"><h3><a name="Not">Not</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="Or">Or</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="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 [email protected]</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="RemoteAddrInNetwork">RemoteAddrInNetwork</a></h3><p><p> +Checks the IP address of the sending server against a comma- delimited list +of IP addresses, domain names or sub-nets. +</p> +<p> +See AbstractNetworkMatcher for details on how to specify entries. +</p></p></div><div class="section"><h3><a name="RemoteAddrNotInNetwork">RemoteAddrNotInNetwork</a></h3><p><p> +Checks the IP address of the sending server against a comma- delimited list +of IP addresses, domain names or sub-nets. +</p> +<p> +See AbstractNetworkMatcher for details on how to specify entries. +</p></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="SenderInFakeDomain">SenderInFakeDomain (Experimental)</a><a name="SenderInFakeDomain_Experimental"></a></h3><p>Does a DNS lookup (MX and A/CNAME records) +on the sender's domain. If there +are no entries, the domain is considered fake and the match is successful.</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 [email protected]</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 class="section"><h3><a name="Xor">Xor</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><div class="section"><h2>Mailets<a name="Mailets"></a></h2><div class="section"><h3><a +name="AbstractRecipientRewriteTable">AbstractRecipientRewriteTable (Experimental)</a><a name="AbstractRecipientRewriteTable_Experimental"></a></h3><p>Provides an abstraction of common functionality +needed for implementing a +Virtual User Table. Override the <code>mapRecipients</code> method to map +virtual recipients to real recipients.</p></div><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> -</div> - - -<div class="section"> -<h3>AddHabeasWarrantMark<a name="AddHabeasWarrantMark"></a></h3> - -<p>Description: This mailet adds a Habeas warrant mark (see <a class="externalLink" href="http://habeas.com">http://habeas.com</a> for details) to the message.</p> - +<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>Parameters: None.</p> -</div> +<p> +Usage: +</p> +<pre><code> +<mailet match="<suitable-matcher>" class="AddHabeasWarrantMark" /> +</code></pre> -<div class="section"> -<h3>AddHeader<a name="AddHeader"></a></h3> +<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:[email protected]] +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="[email protected]" 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> -<p>Description: This mailet is <b>deprecated</b> .Please use SetMimeHeader .</p> -</div> +This mailet will extract the attachment content from the MimeBodyPart byte[] before +sending it.</p></div><div class="section"><h3><a name="AnotherMailet">AnotherMailet</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="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> -<div class="section"> -<h3>AvalonListserv<a name="AvalonListserv"></a></h3> +<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>Provides basic list server functionality. Implements basic filters for emails sent to the list, -including restriction of senders to members, diallowing attachments in list messages, and subject line -processing</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>Parameters: +<p> +Sample configuration: </p> -<ul> -<li><b>repositoryName</b> (required) - the name of the user repository that contains the users -for this list.</li> +<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> -<li><b>membersonly</b> (optional) - whether only members of the list can send messages to this -list. Defaults to false.</li> +<p> +The probability of being spam is pre-pended to the subject if it is > 0.1 +(10%). +</p> -<li><b>attachmentsallowed</b> (optional) - whether attachments are allowed in messages sent to this -list. Defaults to true.</li> +<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="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> -<li><b>replytolist</b> (optional) - whether the reply-to address for all messages sent to this -list is set to the list address. Defaults to true.</li> +<p> +Sets an email message header indicating the probability that an email message +is SPAM. +</p> -<li><b>subjectprefix</b> (optional) - a String value. If set, this value is prepended to the subject -line of all messages sent to the list.</li> +<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> -<li><b>autobracket</b> (optional) - a boolean value. If a subjectprefix is set, this value determines -whether the prefix is bracketed before being prepended to the subject line. Defaults to true.</li> -</ul> +<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> -</div> +<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> -<div class="section"> -<h3>AvalonListservManager<a name="AvalonListservManager"></a></h3> +<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>Processes list management commands of the form <list-name>-on@<host> and -<list-name>-off@<host> where <list-name> and lt;host> are arbitrary. Note -that this should be used in tandem with a CommandForListserv matcher to ensure that only commands -intended for a specific list are processed.</p> +<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>Parameters: +<p> +The new token frequencies will be stored in a JDBC database. </p> -<ul> -<li><b>repositoryName</b> (required) - the name of the user repository that contains the users -for this list.</li> -</ul> +<p> +Sample configuration: +</p> -</div> +<pre> +<code> +<processor name="root"> + + <mailet match="[email protected]" 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="[email protected]" 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> -<div class="section"> -<h3>BayesianAnalysis<a name="BayesianAnalysis"></a></h3> +<p> +Using the example above, send good messages (ham not spam) to the email +address "[email protected]" to pump good messages into the feeder, and +send spam messages (spam not ham) to the email address "[email protected]" +to pump spam messages into the feeder. +</p> -<p>Description: Spam detection mailet using bayesian analysis techniques.</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>Parameters: +<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> -<ul> -<li><b>repositoryPath</b> (required) - The repositoryPath which is used.</li> +<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> -<li><b>headerName</b> - The HeaderName which get adds to holds the Probalitity. Default is <i>X-MessageIsSpamProbability</i>.</li> +<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="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> -<li><b>ignoreLocalSender</b> - Set to true if you want to ignore messages from local senders. By local sender we mean a return-path -with a local server part (server listed in <servernames> in mailetcontainer.xml). Default is <i>false</i>.</li> +<p> +The new token frequencies will be stored in a JDBC database. +</p> -<li><b>maxSize</b> - Set this to the maximum message size (in bytes) after analysis will be skipped. Default is <i>100000</i>.</li> -</ul> +<p> +Sample configuration: +</p> -</div> +<pre> +<code> +<processor name="root"> + + <mailet match="[email protected]" 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="[email protected]" 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> -<div class="section"> -<h3>BayesianAnalysisFeeder<a name="BayesianAnalysisFeeder"></a></h3> +<p> +Using the example above, send good messages (ham not spam) to the email +address "[email protected]" to pump good messages into the feeder, and +send spam messages (spam not ham) to the email address "[email protected]" +to pump spam messages into the feeder. +</p> -<p>Description: Feeds ham OR spam messages to train the BayesianAnalysis mailet.</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>Parameters: +<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> -<ul> -<li><b>repositoryPath</b> (required) - The repositoryPath which is used.</li> +<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> -<li><b>feedType</b> (required) - The type of the message which is used to feed the mailet. Allowed values are <i>spam</i> and <i>ham</i>.</li> +<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="Bounce">Bounce</a></h3><p><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> +<p> +Bounced messages are attached in their entirety (headers and content) and the +resulting MIME part type is "message/rfc822".<br> +The reverse-path and the Return-Path header of the response is set to "null" +("<>"), meaning that no reply should be sent. +</p> +<p> +A sender of the notification message can optionally be specified. If one is +not specified, the postmaster's address will be used.<br> +A notice text can be specified, and in such case will be inserted into the +notification inline text.<br> +If the notified message has an "error message" set, it will be inserted into +the notification inline text. If the <code>attachError</code> init +parameter is set to true, such error message will be attached to the +notification message.<br> +<p> +Supports the <code>passThrough</code> init parameter (true if missing). +</p> +<p/> +<p> +Sample configuration: +</p> +<p/> +<pre> +<code> +<mailet match="All" class="Bounce"> + <sender><i>an address or postmaster or sender or unaltered, default=postmaster</i></sender> + <attachError><i>true or false, default=false</i></attachError> + <message><i>notice attached to the original message text (optional)</i></message> + <prefix><i>optional subject prefix prepended to the original message</i></prefix> + <inline><i>see {@link Resend}, default=none</i></inline> + <attachment><i>see {@link Resend}, default=message</i></attachment> + <passThrough><i>true or false, default=true</i></passThrough> + <fakeDomainCheck><i>true or false, default=true</i></fakeDomainCheck> + <debug><i>true or false, default=false</i></debug> +</mailet> +</code> +</pre> +<p/> +<p> +The behaviour of this mailet is equivalent to using Resend with the following +configuration: +</p> +<p/> +<pre> +<code> +<mailet match="All" class="Resend"> + <sender><i>an address or postmaster or sender or unaltered</i></sender> + <attachError><i>true or false</i></attachError> + <message><i><b>dynamically built</b></i></message> + <prefix><i>a string</i></prefix> + <passThrough>true or false</passThrough> + <fakeDomainCheck><i>true or false</i></fakeDomainCheck> + <recipients><b>sender</b></recipients> + <reversePath>null</reversePath> + <inline>see {@link Resend}</inline> + <attachment>see {@link Resend}</attachment> + <isReply>true</isReply> + <debug><i>true or false</i></debug> +</mailet> +</code> +</pre> +<p> +<i>notice</i> and <i>sendingAddress</i> can be used instead of <i>message</i> +and <i>sender</i>; such names are kept for backward compatibility. +</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>[email protected]</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="CustomMailet">CustomMailet</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="DSNBounce">DSNBounce</a></h3><p><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> +<p> +Bounced messages are attached in their entirety (headers and content) and the +resulting MIME part type is "message/rfc822".<br> +The reverse-path and the Return-Path header of the response is set to "null" +("<>"), meaning that no reply should be sent. +</p> +<p> +A sender of the notification message can optionally be specified. If one is +not specified, the postmaster's address will be used.<br> +<p> +Supports the <code>passThrough</code> init parameter (true if missing). +</p> +<p/> +<p> +Sample configuration: +</p> +<p/> +<pre> +<code> +<mailet match="All" class="DSNBounce"> + <sender><i>an address or postmaster or sender or unaltered, + default=postmaster</i></sender> + <prefix><i>optional subject prefix prepended to the original + message</i></prefix> + <attachment><i>message, heads or none, default=message</i></attachment> + <messageString><i>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] ... </i></messageString> + <passThrough><i>true or false, default=true</i></passThrough> + <debug><i>true or false, default=false</i></debug> +</mailet> +</code> +</pre></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="Forward">Forward</a></h3><p><p> +Replaces incoming recipients with those specified, and resends the message +unaltered. +</p> +<p> +Can be totally replaced by an equivalent usage of {@link Resend} (see below), +simply replacing <i><forwardto></i> with <i><recipients></i>. -<li><b>maxSize</b> - Set this to the maximum message size (in bytes) after analysis will be skipped. Default is <i>100000</i>.</li> -</ul> +<p> +Sample configuration: +</p> -</div> +<pre> +<code> +<mailet match="All" class="Forward"> + <forwardTo><i>comma delimited list of email addresses</i></forwardTo> + <passThrough><i>true or false, default=false</i></passThrough> + <fakeDomainCheck><i>true or false, default=true</i></fakeDomainCheck> + <debug><i>true or false, default=false</i></debug> +</mailet> +</code> +</pre> +<p> +The behaviour of this mailet is equivalent to using Resend with the following +configuration: +</p> -<div class="section"> -<h3>Bounce<a name="Bounce"></a></h3> +<pre> +<code> +<mailet match="All" class="Resend"> + <recipients>comma delimited list of email addresses</recipients> + <passThrough>true or false</passThrough> + <fakeDomainCheck><i>true or false</i></fakeDomainCheck> + <debug><i>true or false</i></debug> +</mailet> +</code> +</pre> +<p> +<i>forwardto</i> can be used instead of <i>forwardTo</i>; such name is kept +for backward compatibility. +</p></p></div><div class="section"><h3><a name="FromRepository">FromRepository (Experimental)</a><a name="FromRepository_Experimental"></a></h3><p>Mailet Info: <b>FromRepository Mailet</b><br +/></p><p>Re-spools Mail found in the specified Repository. -<p>Description: Generates a response to the reverse-path address.</p> +<pre> +<mailet match="RecipientIs=respool@localhost" class="FromRepository"> + <repositoryPath> <i>repository path</i> </repositoryPath> + <processor> <i>target processor</i> </repositoryPath> + <delete&t; [true|<b>false</b>] </delete> +</mailet> +</pre></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: -<p>Parameters: -</p> -<ul> +<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. -<li><b>sender</b> - The senderAddress which will be used for sending the bounce. Possible values: <i>address</i>, <i>postmaster</i> , <i>sender</i>, -<i>unaltered</i>. Default <i>postmaster</i>.</li> +The following headers will be added : X_MEETING_UID, X_MEETING_METHOD, X_MEETING_RECURRENCE_ID, X_MEETING_SEQUENCE, +X_MEETING_DTSTAMP -<li><b>attachError</b> - Attach error. Default is false.</li> +The only configuration parameter for this mailet is the attribute the ICAL4J Calendar map should be attached to, +named <b>attribute</b>. -<li><b>message</b> - Set the message which get included in the bounce.</li> +Configuration example : -<li><b>prefix</b> - Optional subject prefix prepended to the original message.</li> +<pre> + <code> + <mailet matcher=??? class=ICALToHeader> + <attribute>icalendars</attribute> + </mailet> + </code> +</pre></p><
<TRUNCATED> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
