org.apache.james.transport.mailets |
Core mailets for use with the Mailet API.
|
Java Source File Name | Type | Comment |
AbstractAddFooter.java | Class | |
AbstractNotify.java | Class | Abstract mailet providing configurable notification services.
This mailet can be subclassed to make authoring notification mailets simple.
Provides the following functionalities to all notification subclasses:
- A common notification message layout.
- A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
- A notice text can be specified, and in such case will be inserted into the
notification inline text.
- If the notified message has an "error message" set, it will be inserted into the
notification inline text.
|
AbstractRedirect.java | Class | Abstract mailet providing configurable redirection services.
This mailet can be subclassed to make authoring redirection mailets simple.
By extending it and overriding one or more of these methods new behaviour can
be quickly created without the author having to address any other issue than
the relevant one:
- attachError() , should error messages be appended to the message
- getAttachmentType(), what should be attached to the message
- getInLineType(), what should be included in the message
- getMessage(), The text of the message itself
- getRecipients(), the recipients the mail is sent to
- getReplyTo(), where replies to this message will be sent
- getReversePath(), what to set the reverse-path to
- getSender(), who the mail is from
- getSubject(), a string to replace the message subject
- getSubjectPrefix(), a prefix to be added to the message subject, possibly already replaced by a new subject
- getTo(), a list of people to whom the mail is *apparently* sent
- isReply(), should this mailet set the IN_REPLY_TO header to the id of the current message
- getPassThrough(), should this mailet allow the original message to continue processing or GHOST it.
- getFakeDomainCheck(), should this mailet check if the sender domain address is valid.
- isStatic(), should this mailet run the get methods for every mail, or just once.
For each of the methods above (generically called "getX()" methods in this class
and its subclasses), there is an associated "getX(Mail)" method and most times
a "setX(Mail, Tx, Mail)" method.
The roles are the following:
- a "getX()" method returns the correspondent "X" value that can be evaluated "statically"
once at init time and then stored in a variable and made available for later use by a
"getX(Mail)" method;
- a "getX(Mail)" method is the one called to return the correspondent "X" value
that can be evaluated "dynamically", tipically based on the currently serviced mail;
the default behaviour is to return the value of getX();
- a "setX(Mail, Tx, Mail)" method is called to change the correspondent "X" value
of the redirected Mail object, using the value returned by "gexX(Mail)";
if such value is null, it does nothing.
Here follows the typical pattern of those methods:
...
|
AbstractVirtualUserTable.java | Class | Provides an abstraction of common functionality needed for implementing
a Virtual User Table. |
AddFooter.java | Class | This mailet will attach text to the end of the message (like a footer). |
AddFooterTest.java | Class | |
AddHabeasWarrantMark.java | Class | |
AddHeader.java | Class | |
AvalonListserv.java | Class | MailingListServer capability.
Requires a configuration element in the config.xml file of the form:
<mailet match="RecipientIs=LIST-ADDRESS" class="AvalonListserv">
<repositoryName>LIST-NAME</repositoryName>
<membersonly>[true|false]</membersonly>
<attachmentsallowed>[true|false]</attachmentsallowed>
<replytolist>[true|false]</replytolist>
<autobracket>[true|false]</autobracket>
<subjectprefix [xml:space="preserve"]>SUBJECT-PREFIX</subjectprefix>
</mailet>
repositoryName - the name of a user repository configured in the
UsersStore block, e.g.,
<repository name="list-name" class="org.apache.james.userrepository.ListUsersJdbcRepository" destinationURL="db://maildb/lists/list-name">
<sqlFile>file://conf/sqlResources.xml</sqlFile>
</repository>
or
<repository name="list-name" class="org.apache.james.userrepository.UsersFileRepository">
<destination URL="file://var/lists/list-name/"/>
</repository>
membersonly - if true only members can post to the list
attachmentsallowed - if false attachments are not allowed
replytolist - if true, replies go back to the list address; if
false they go to the sender.
subjectprefix - a prefix that will be inserted at the front of
the subject. |
AvalonListservManager.java | Class | Adds or removes an email address to a listserv. |
BayesianAnalysis.java | Class | Spam detection mailet using bayesian analysis techniques.
Sets an email message header indicating the
probability that an email message is SPAM.
Based upon the principals described in:
A Plan For Spam
by Paul Graham. |
BayesianAnalysisFeeder.java | Class | Feeds ham OR spam messages to train the
BayesianAnalysis mailet.
The new token frequencies will be stored in a JDBC database.
Sample configuration:
<processor name="root">
<mailet match="RecipientIs=not.spam@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).
|
Bounce.java | Class | 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.
Bounced messages are attached in their entirety (headers and
content) and the resulting MIME part type is "message/rfc822".
The reverse-path and the Return-Path header of the response is set to "null" ("<>"),
meaning that no reply should be sent.
A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
A notice text can be specified, and in such case will be inserted into the
notification inline text.
If the notified message has an "error message" set, it will be inserted into the
notification inline text. |
ClamAVScan.java | Class | Does an antivirus scan check using a ClamAV daemon (CLAMD)
Interacts directly with the daemon using the "stream" method,
which should have the lowest possible overhead.
The CLAMD daemon will typically reside on localhost, 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).
Handles the following init parameters:
<debug> .
<host> : the host name of the server where CLAMD runs. |
CommandListservFooter.java | Class | CommandListservFooter is based on the AddFooter mailet. |
CommandListservManager.java | Class | CommandListservManager is the default implementation of
ICommandListservManager . |
CommandListservProcessor.java | Class | CommandListservProcessor processes messages intended for the list serv mailing list. |
DSNBounce.java | Class | 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.
Bounced messages are attached in their entirety (headers and
content) and the resulting MIME part type is "message/rfc822".
The reverse-path and the Return-Path header of the response is set to "null" ("<>"),
meaning that no reply should be sent.
A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
Supports the passThrough init parameter (true if missing).
Sample configuration:
<mailet match="All" class="DSNBounce">
<sender>an address or postmaster or sender or unaltered,
default=postmaster</sender>
<prefix>optional subject prefix prepended to the original
message</prefix>
<attachment>message, heads or none, default=message</attachment>
<messageString>the message sent in the bounce, the first occurrence of the pattern [machine] is replaced with the name of the executing machine, default=Hi.
|
Forward.java | Class | Replaces incoming recipients with those specified, and resends the message unaltered.
Can be totally replaced by an equivalent usage of
Resend (see below),
simply replacing <forwardto> with <recipients>. |
FromRepository.java | Class | Re-spools Mail found in the specified Repository. |
GenericListserv.java | Class | An abstract implementation of a listserv. |
GenericListservManager.java | Class | An abstract implementation of a listserv manager. |
ICommandListservManager.java | Interface | ICommandListservManager is the interface that describes the functionality of any
command based list serv managers. |
JDBCAlias.java | Class | Rewrites recipient addresses based on a database table. |
JDBCListserv.java | Class | Rewrites recipient addresses based on a database table. |
JDBCVirtualUserTable.java | Class | Implements a Virtual User Table for JAMES. |
LocalDelivery.java | Class | Receives a Mail from JamesSpoolManager and takes care of delivery of the
message to local inboxes. |
LogMessage.java | Class | Logs Message Headers and/or Body.
If the "passThrough" in confs is true the mail will be left untouched in
the pipe. |
MailetLoaderTestMailet.java | Class | |
NotifyPostmaster.java | Class | Sends a notification message to the Postmaster.
A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
The "To:" header of the notification message can be set to "unaltered";
if missing will be set to the postmaster.
A notice text can be specified, and in such case will be inserted into the
notification inline text.
If the notified message has an "error message" set, it will be inserted into the
notification inline text. |
NotifySender.java | Class | Sends a notification message to the sender of a message.
A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
The "To:" header of the notification message can be set to "unaltered";
if missing will be set to the sender of the notified message.
A notice text can be specified, and in such case will be inserted into the
notification inline text.
If the notified message has an "error message" set, it will be inserted into the
notification inline text. |
Null.java | Class | Simplest Mailet which destroys any incoming messages. |
PostmasterAlias.java | Class | Rewrites recipient addresses to make sure email for the postmaster is
always handled. |
Redirect.java | Class | A mailet providing configurable redirection services.
Can produce listserver, forward and notify behaviour, with the original
message intact, attached, appended or left out altogether.
It differs from
Resend because
(i) some defaults are different,
notably for the following parameters: <recipients>, <to>,
<reversePath> and <inline>;
(ii) because it allows the use of the <static> parameter;.
Use Resend if you need full control, Redirect if
the more automatic behaviour of some parameters is appropriate.
This built in functionality is controlled by the configuration as laid out below.
In the table please note that the parameters controlling message headers
accept the "unaltered" value, whose meaning is to keep the associated
header unchanged and, unless stated differently, corresponds to the assumed default
if the parameter is missing.
The configuration parameters are:
<recipients> |
A comma delimited list of addresses for recipients of
this message; it will use the "to" list if not specified, and "unaltered"
if none of the lists is specified.
These addresses will only appear in the To: header if no "to" list is
supplied.
Such addresses can contain "full names", like
Mr. | RemoteDelivery.java | Class | Receives a MessageContainer from JamesSpoolManager and takes care of delivery
the message to remote hosts. | RemoteDeliverySocketFactory.java | Class | It is used by RemoteDelivery in order to make possible to bind the client
socket to a specific ip address.
This is not a nice solution because the ip address must be shared by all
RemoteDelivery instances. | RemoveAllMailAttributes.java | Class | | RemoveMailAttribute.java | Class | This mailet sets attributes on the Mail. | Resend.java | Class | A mailet providing configurable redirection services.
Can produce listserver, forward and notify behaviour, with the original
message intact, attached, appended or left out altogether.
Can be used as a replacement to
Redirect , having more consistent defaults,
and new options available.
Use Resend if you need full control, Redirect if
the more automatic behaviour of some parameters is appropriate.
This built in functionality is controlled by the configuration as laid out below.
In the table please note that the parameters controlling message headers
accept the "unaltered" value, whose meaning is to keep the associated
header unchanged and, unless stated differently, corresponds to the assumed default
if the parameter is missing.
The configuration parameters are:
<recipients> |
A comma delimited list of addresses for recipients of this message.
Such addresses can contain "full names", like
Mr. | ServerTime.java | Class | Returns the current time for the mail server. | SetMailAttribute.java | Class | This mailet sets attributes on the Mail. | SetMimeHeader.java | Class | Adds a specified header and value to the message. | SetMimeHeaderTest.java | Class | | ToMultiRepository.java | Class | Receives a Mail from JamesSpoolManager and takes care of delivery of the
message to local inboxes or a specific repository. | ToProcessor.java | Class | | ToProcessorTest.java | Class | | ToRepository.java | Class | Stores incoming Mail in the specified Repository.
If the "passThrough" in confs is true the mail will be returned untouched in
the pipe. | UseHeaderRecipients.java | Class | Mailet designed to process the recipients from the mail headers rather
than the recipients specified in the SMTP message header. | UsersRepositoryAliasingForwarding.java | Class | Receives a Mail from JamesSpoolManager and takes care of delivery of the
message to local inboxes.
Available configurations are:
true: specify wether the user aliases should
be looked up or not. | WhiteListManager.java | Class | Manages for each local user a "white list" of remote addresses whose messages
should never be blocked as spam.
The normal behaviour is to check, for a local sender, if a remote recipient
is already in the list: if not, it will be automatically inserted. | XMLVirtualUserTable.java | Class | Implements a Virtual User Table to translate virtual users
to real users. |
| |