From 891691e2d19aa0cdf142358dc34e226a7e41f59f Mon Sep 17 00:00:00 2001
From: bago User accounts are shared across services. A common user repository is shared across James
+services. That is, once you've created a POP3 mail account and set a password, that same
+account is available for authenticated SMTP and NNTP. In James, user accounts are created throught the RemoteManager. So, after installation is complete, the first step to adding users
+is to configure the RemoteManager. More information on RemoteManager configuration can be found
+here. You will need to have configured at least one administrator account and
+ensured that the RemoteManager is enabled. Also, you need to make sure that your user repository configuration is correct before adding any users. If
+you change your user repository type (i.e. file to database) or the configuration of your user repository
+(i.e. the file or database URL) after you have added users, you may lose your user data. Please change these
+values with care. After you've done this, restart James to ensure that any changes you've made in the configuration are incorporated into
+the running system. You are now ready to create user accounts. Once James is up and listening, adding a user is simple: That's it. Your user accounts are now created and can be used by all James services. This step is not necessary to use the standard out of the box version of James. A
+pre-built binary version of James is available from the James download directory. But
+if you wish to customize the James source code, it will be necessary for you to build the
+distribution yourself.
+ There are two ways to get the James source code. 1. Download the source distribution - the source is available from the
+James release mirrors.
+Simply choose the version of James you'd like to download, and pick the source distribution appropriate for your platform.
+ 2. Get the source code using CVS - this method gives you access to the cutting edge code
+base. Instructions on how to use CVS to get the James source code (the jakarta-james distribution)
+can be found here.
+ To run the build you need two third-party tools. 1. Java Development Kit - You must have a JDK of Java version 1.3 or higher installed to build the
+James distribution. The exact JDKs available depend on the platform. A JDK must be downloaded and
+installed before the build can run. 2. Ant - This is a Java-tailored, XML-configured, extensible build or make system. The James
+source tree includes Ant v1.5. You can get the latest version of Ant
+here. Since Ant is currently included in the source
+distribution, it is not necessary to download it separately. In the top level directory of the source distribution James includes two helper scripts for running
+the build. The script build.bat should be used on Windows systems, while build.sh is appropriate for
+Unix systems. Each script takes an optional set of arguments that tell the script exactly what to build. To use these scripts, simple set the environment variable JAVA_HOME to the base directory of the
+JDK. Then run the build script, optionally with any of the following command line arguments:
+hi
+2. You will be prompted for your administrator userid and password. Enter the values you specified
+in the James config.xml.
+3. After logging in, type "adduser <user> <password>" where <user> is the user name
+and <password> is the password of the account you wish to create. Please note that the user name
+should NOT be a complete email address. Rather, all email addresses of the form <user>@<domain>
+(where <domain> is any of the values specified in the <servernames> block) will be delivered to
+this account by default. Mailet configuration can change this default behavior.
+4. Repeat step 3 for all user accounts you wish to create.
+
+
+
All build products are output in the dist subdirectory of the James source distribution directory. There +is also a build subdirectory of the James source distribution directory that is created during the build process. Both +of these directories will be deleted if you run build with the clean argument.
+Warning! Any changes you've made in the 'dist' directory +will be lost after a recompilation. If you are making changes to the config.xml +or other files, we recommend you backup and then change the copies in src to +avoid losing work.
+ + + + diff --git a/server/2.2.0/src/site/xdoc/changelog.xml b/server/2.2.0/src/site/xdoc/changelog.xml new file mode 100644 index 00000000000..d9841e13ebd --- /dev/null +++ b/server/2.2.0/src/site/xdoc/changelog.xml @@ -0,0 +1,446 @@ + + +This is a document that records what was done between releases. As always, thank you to everyone who contributed code, documentation, bug reports, and feedback. +
+Released 15 June 2004
++Below are some highlights of features and changes already available: +
Details
+ +Released 12 May 2003
+Released 21 February 2003
+Released 11 February 2003
+Released 29 December 2002
+Released 20 April 2002
+Released 1 December 2001
+Released 26 October 2001
+Released 13 December 2000
+Released 16 October 2000
+Release 27 July 2000
+Released 26 February 2000
+Released early 2000
+Unknown release date
+Check out our Who We Are page to see who to thank.
+Implementing a custom mailet is generally a simple task, most of whose complexity +lies in coding the actual work to be done by the mailet. This is largely due to the +simplicity of the Mailet interface and the fact that a GenericMailet class is provided +as part of the Mailet package.
+In this discussion we will assume that any mailet being implemented is a subclass of +GenericMailet. The GenericMailet class serves to abstract away of the configuration and +logging details. While it provides a noop implementation of the init() and destroy() methods, +these can be easily overridden to provide useful functionality.
+In general, the only four methods that you should need to implement are init(), destroy(), +getMailetInfo(), and service(Mail). And only the last is required in all cases.
+As described in the SpoolManager configuration +section, mailets are configured with a set of String (name, value) pairs. These values are +passed into the Mailet upon initialization (although the details of this process are hidden by +the GenericMailet implementation). GenericMailet provides access to this configuration +information through use of the getInitParameter(String) method. Passing in the name of the +requested configuration value will yield the value if set, and null otherwise. Configuration +values are available inside the init(), destroy(), and service(Mail) methods.
+There is a simple logging mechanism provided by the Mailet API. It does not support +logging levels, so any log filtering will have to be implemented in the Mailet code. +Logging is done by calling one of the two logging methods on GenericMailet - log(String) +or log(String,Throwable). Logging is available inside the init(), destroy(), and service(Mail) +methods.
+The value of getMailetInfo() for the Mailet is prepended to the log entries for that +Mailet. So it may be desirable for you to override this method so you can distinguish mailet +log entries by Mailet.
+As part of the Mailet lifecycle, a Mailet is guaranteed to be initialized immediately after +being instantiated. This happens once and only once for each Mailet instance. The +Initialization phase is where configuration parsing and per-Mailet resource creation generally +take place. Depending on your Mailet, it may or may not be necessary to do any initialization +of the mailet. Initialization logic is implemented by overriding the init() method of +GenericMailet.
+The bulk of the Mailet logic is expected to be invoked from the service(Mail) method. This +method is invoked each time a mail message is to be processed by the mailet. The message is +passed in as an instance of the Mail interface, which is part of the Mailet API.
+The Mail interface is essentially a light wrapper around JavaMail's MimeMessage class with a +few important differences. See the Javadoc for the interface for a description of the additional +methods available on this wrapper.
+As part of the Mailet lifecycle, a Mailet is guaranteed to be destroyed when the container +cleans up the Mailet. This happens once and only once for each Mailet instance. The +Destruction phase is where per-Mailet resource release generally takes place. Depending +on your Mailet, it may or may not be necessary to do any destruction +of the mailet. Destruction logic is implemented by overriding the destroy() method of +GenericMailet.
+Once a Mailet has been successfully implemented there are only a couple of +additional steps necessary to actually deploy the Mailet.
++The Mailet must be added to James' classpath so that the Mailet can be loaded by James. There +are two ways to add a custom Mailet to the classpath so that James will be able to load the +Mailet. These are: +
++1. Download the source distribution, add a jar file containing the custom files to the lib +directory of the unpacked source distribution, and build a new .sar file by following the +directions here. This new .sar file will now +include your custom classes. +
++or +
++2. Place a jar file containing the custom class files in the lib subdirectory of the James +installation. It will also be necessary to unpack the JavaMail and James jar files from +the provided .sar file and add them to this directory. +
+Configuration of the processor chain is discussed +elsewhere in this documentation. The +details of configuring mailet deployment is discussed at length. Here we will only comment +that it is important to add the appropriate mailet package for your custom mailet to the +<mailetpackages> list and that the name of your mailet should not conflict with any of +the mailets described here. +
+Implementing a custom matcher is generally a simple task, most of whose complexity +lies in coding the actual work to be done by the matcher. This is largely due to the +simplicity of the Matcher interface and the fact that a couple of abstract Matcher template +classes are provided in the Mailet package. These two classes, GenericMatcher and +GenericRecipientMatcher, greatly simplfy the task of Matcher authoring.
+As discussed elsewhere in this manual, the Matcher interface does not simply match +or not match a particular message. Rather, it returns some subset of the original message +recipients as a result of the match(Mail) method. This leads to the two different abstract +Matcher implementations.
+The first, GenericMatcher, is intended for matchers where recipient evaluation is not +necessary. Basically, you should subclass this implementation if your matcher is going to +return all or none of the recipients.
+When subclassing this class, there are four methods that potentially need to be +overridden. These are getMatcherInfo(), init(), match(Mail), and destroy(). More on these +anon.
+The second implementation, GenericRecipientMatcher, is intended for those matchers where +each recipient is evaluated individually. It is a subclass of GenericMatcher, and inherits +most of its behavior from that class. The only major difference is that subclasses are +expected to override matchRecipient(MailAddress) rather than match(Mail).
+Matchers are passed a single String as part of their configuration. Interpretation of this +list is left entirely to the body of the Matcher. This String value is available in +the body of the Matcher through use of the getCondition() method of the +GenericMatcher class. This method returns the String value passed to the Matcher, and returns +null if no value is set. The method getCondition() is available inside the init(), destroy(), match(Mail), +and matchRecipient(MailAddress) methods.
+There is a simple logging mechanism provided by the Mailet API. It does not support +logging levels, so any log filtering will have to be implemented in the Matcher code. +Logging is done by calling one of the two logging methods on GenericMatcher/GenericRecipientMatcher - log(String) +or log(String,Throwable). Logging is available inside the init(), destroy(), match(Mail), +and matchRecipient(MailAddress) methods.
+The value of getMatcherInfo() for the Matcher is prepended to the log entries for that +Matcher. So it may be desirable for you to override this method so you can distinguish Matcher +log entries by Matcher.
+As part of the Matcher lifecycle, a Matcher is guaranteed to be initialized immediately after +being instantiated. This happens once and only once for each Matcher instance. The +Initialization phase is where configuration parsing and per-Matcher resource creation generally +take place. Depending on your Matcher, it may or may not be necessary to do any initialization +of the Matcher. Initialization logic is implemented by overriding the init() method of +GenericMatcher/GenericRecipientMatcher.
+It is the matching phase where the Matcher's work is done. The exact form of this phase largely +depends on which Matcher superclass is subclassed.
+If GenericMatcher is being subclassed, it is the match(Mail) that is implemented. As described +above, this method returns a Collection of MailAddresses that is a subset of the original +recipients for the Mail object.
+If it is a purely recipient-filtering Matcher, then the GenericRecipientMatcher should be +subclassed. In this case, developers must provide an implementation of the +matchRecipient(MailAddress) method. This method returns true if the recipient matches, +and false otherwise.
+As part of the Matcher lifecycle, a Matcher is guaranteed to be destroyed when the container +cleans up the Matcher. This happens once and only once for each Matcher instance. The +Destruction phase is where per-Matcher resource release generally takes place. Depending +on your Matcher, it may or may not be necessary to do any destruction +of the Matcher. Destruction logic is implemented by overriding the destroy() method of +GenericMatcher/GenericRecipientMatcher.
+Once a Matcher has been successfully implemented there are only a couple of +additional steps necessary to actually deploy the Matcher.
++The Matcher must be added to James' classpath so that the Matcher can be loaded by James. There +are two ways to add a custom Matcher to the classpath so that James will be able to load the +Matcher. These are: +
++1. Download the source distribution, add a jar file containing the custom files to the lib +directory of the unpacked source distribution, and build a new .sar file by following the +directions here. This new .sar file will now +include your custom classes. +
++or +
++2. Place a jar file containing the custom class files in the lib subdirectory of the James +installation. It will also be necessary to unpack the JavaMail and James jar files from +the provided .sar file and add them to this directory. +
+Configuration of the processor chain is discussed +elsewhere in this documentation. The +details of configuring matcher deployment is discussed at length. Here we will only comment +that it is important to add the appropriate matcher package for your custom matcher to the +<matcherpackages> list and that the name of your matcher should not conflict with any of +the matchers described here. +
+DNS Transport services are controlled by a configuration block in +the config.xml. This block affects SMTP remote delivery.
+ +The dnsserver tag defines the boundaries of the configuration +block. It encloses all the relevant configuration for the DNS server. +The behavior of the DNS service is controlled by the attributes and +children of this tag.
+ +The standard children of the dnsserver tag are:
+This should always be false unless you understand the implications.
+fetchmail acts as a gateway between an external message store such as an IMAP +or POP3 server and James. Mail is fetched from the external message store and +injected into the James input spool.
+ +fetchmail is useful when delivery via standard SMTP is not an option, as a +means of consolidating mail delivered to several external accounts into a single +James account, or to apply the mail processing capabilities of James to mail +stored in an external message store.
+ +fetchmail has several configuration options that control the fetching and +filtering of mail injected into the James input spool. Once there, James' +flexible mail processing engine can be used to further process the mail, just as +if it had been delivered via standard SMTP.
+ +
+How fetchmail Works
+fetchmail Configuration Parameters
+fetchmail Examples
+fetchmail Caveats
+
Mail is delivered by periodically running fetch tasks that read messages from +an external message store and injects them into the James input spool. Fetch +tasks run concurrently.
+ +A set of filters applies to each fetch task. Each filter provides the ability +to reject a message that matches the filter criteria. Rejected messages are not +injected into the James input spool; they are either marked as seen or deleted. +When a filter is configured to accept a message that matches its criteria, +messages are marked with a MailAttribute. This MailAttribute can be detected +within the James matcher/mailet chain, allowing further processing as +required.
+ +Each fetch task is associated with a single host server. Accounts are defined +to the fetch task for each mailbox on the server from which mail is to be +fetched. Accounts run consecutively.
+ +Optionally, the fetch task can be configured with an <alllocal> Account that +generates an Account entry for each user defined in the James user repository. +This removes the requirement to manually add or remove Account entries to the +fetchmail configuration each time a James user is added or removed. Currently +this is only useful if the server supports virtual mailboxes that allow the same +password to apply to all users within a domain.
+ +Accounts can be configured to deliver all mail for an Account to a specified +recipient or to deduce the intended recipient from the mail headers.
+ +Accounts are normally configured to deliver all mail for an Account to a +specified recipient, ignoring the recipient in the mail headers. This works well +in the majority of cases where a mailbox is guaranteed to contain mail for a sole +mailbox recipient.
+ +Accounts are configured to deduce the intended recipient from the mail headers +when a mailbox contains mail for several users, typically all users in a domain. +Used alone, this is not foolproof as there are circumstances when a single unique +recipient cannot be deduced from the mail headers alone. Used in conjunction with +an appropriately configured <alllocal> account, it is always possible to deduce +the intended recipient when the recipient is a James user.
+The fetchmail configuration parameters are part of the James configuration,
+whose base file is config.xml. For clarity and flexibility, the
+fetchmail configuration parameters are stored in the file
+james-fetchmail.xml, which is referenced within
+config.xml.
The configuration parameters are described below.
+ +The configuration block delimited by the fetchmail tag +controls fetchmail.
+ +The tag has these attributes: +
The tag has these child tags (minimum cardinality, maximum cardinality): +
+
The fetch tag defines a fetch task to be run +periodically. Fetch tasks run concurrently.
+ +The tag has these attributes: +
The tag has these child tags (minimum cardinality, maximum cardinality): +
+
The accounts tag declares the accounts from which mail will +be fetched by the fetch task. Accounts run concurrently.
+ +The tag has these child tags (minimum cardinality, maximum cardinality): +
+ + +
+
The blacklist tag declares a list of recipient addresses +for whom mail will be rejected and what happens to the rejected mail.
+ +The tag value is a tab, comma or space delimited list of recipient
+addresses, eg: wibble@mydomain.com, flobble@mydomain.com.
The tag has these attributes: +
org.apache.james.fetchmail.isBlacklistedRecipient
+added to the mail.
+
The defaultdomain tag declares the domain name to be
+appended to the From: header of a mail that has a valid user part
+but is missing the domain part.
If not specified, the default behaviour is to append the canonical host name +of the James server.
+ +The tag value is the name of the server to append. The name must be a server
+declared in the servernames tag of the James
+block in the configuration or the name localhost.
+
The fetchall tag declares if all mail should be fetched from +the server, or just unseen mail.
+ +The tag value is a boolean. If true, all mail is fetched. If false, only +unseen mail is fetched.
+ +
+
The fetched tag declares what will happen to mail on the +external server that is successfully injected into the James input spool.
+ +The tag has these attributes: +
+
The host tag declares the IP address of the external +server from which mail is fetched.
+ +The tag value is the DNS name or IP address literal of the external +server.
+ +
+
The interval tag declares the period between invocations of +the fetch tasks. If a fetch task is still active from a previous invocation +when the period expires, the new invocation is skipped over.
+ +The tag value is an integer representing the number of milliseconds to elapse +between invocations of the fetch tasks.
+ +
+
The javaMailFolderName tag declares the name of the root +folder on the external server from which mail is fetched.
+ +The tag value is the cAsE-sEnSiTiVe name of the root folder on the external
+server from which mail is fetched. For POP3 servers this is always
+INBOX.
+
The javaMailProperties tag declares the properties to be
+applied to the JavaMail Session used by the fetch task. These override the
+properties answered by System.getProperties(). Many JavaMail
+properties are specific to the JavaMail Provider selected by the
+javaMailProviderName tag.
Relying on the default values selected by the Provider can be +inappropriate. For instance, the default connection and I/O timeout +values of infinite for the default IMAP and POP3 Providers is rarely what is +required. Consult the documentation of the Provider for details and options.
+ +Documentation for the default Provider for IMAP is located + +here.
+ +Documentation for the default Provider for POP3 is located + +here.
+ +Details of how to change a Provider are located + +here.
+ +The tag has these child tags (minimum cardinality, maximum cardinality): +
+
The javaMailProviderName tag selects the JavaMail protocol +Provider used to interact with the external server.
+ +The tag value is the name of a JavaMail supported protocol, such as
+pop3 or imap. The name is used to select the default
+Provider for the protocol.
+
The maxmessagesize tag declares the maximum permitted message +size for messages injected into the James input spool and what happens to fetched +messages that exceed this size.
+The tag has these attributes: +
org.apache.james.fetchmail.isMaxMessageSizeExceeded added prior to
+injection into the James input spool, (see below for the location of an example).
+
An example configuration using James mailet processing to bounce fetched
+messages that exceed the maximum permitted size can be found in the file
+$PHOENIX_HOME/apps/james/conf/samples/fetchmail/maxMessageSize.xml.
+
The recipientnotfound tag declares what happens to mail for +which a sole intended recipient cannot be found when attempting to determine +the recipient from the mail headers.
+ +In configurations with more than one account per fetch task, processing of +matched mail can be deferred to the next run of the fetch task. This gives +other accounts that may be able to determine a sole intended recipient an +opportunity to do so before recipientnotfound processing is invoked.
+ +The tag has these attributes: +
org.apache.james.fetchmail.isRecipientNotFound added to the
+mail.
+
The recursesubfolders tag declares if mail should be fetched +from sub-folders of the root folder, or just the root folder.
+ +The tag value is a boolean. If true, mail is fetched from the root folder and +its subfolders. If false, mail is fetched from just the root folder.
+ +
+
The remoteReceivedHeader tag declares the zero based +index of the RFC2822 compliant RECEIVED header used to determine the address and +host name of the remote MTA that sent a fetched message and what happens to +messages when the specified header is invalid.
+ +Typically, the first (index = 0) RECEIVED header is for the local MTA that +delivered the message to the message store and the second (index = 1) RECEIVED +header is for the remote MTA that delivered the message to the local MTA. When +this configuration applies, the remoteReceivedHeaderIndex should +be set to 1. +
+ +To verify the correct setting, examine the RECEIVED headers for messages +delivered to the configured message store and locate the first one containing a +remote domain in the'from' field. Remembering that zero based indexing is used, +if this the second header, use an index of 1, if this is the third header, use an +index of 2, and so forth.
+ +Matchers such as InSpammerBlacklist use the remote address and/or remote host
+name to identify illegitimate remote MTAs. If you do not use such matchers, the
+remoteReceivedHeaderIndex tag may be omitted or the default
+index value of -1 can be specified. This causes the remote address to be set to
+127.0.0.1 and the remote host name to be set to
+localhost. Matchers almost always considered these values to be
+legitimate.
The tag has these attributes: +
org.apache.james.fetchmail.isInvalidReceivedHeader
+added to the mail, the remote address set to 127.0.0.1 and the remote
+host name set to localhost.
+
+
An example configuration using James mailet processing to notify the postmaster
+of fetched messages that contain an invalid Received header can be found in the file
+$PHOENIX_HOME/apps/james/conf/samples/fetchmail/remoteReceivedHeader.xml.
+
The remoterecipient tag declares what happens to mail for +which the domain part of the recipient is remote. A domain is remote if it is +not a server declared in the servernames tag of the +James block in the configuration.
+ +The tag has these attributes: +
org.apache.james.fetchmail.isRemoteRecipient added to the mail.
+
+
The undeliverable tag declares what happens to mail that +cannot be delivered.
+ +The tag has these attributes: +
+
The userundefined tag declares what happens to mail for +which the recipient is not defined as a James user.
+ +The tag has these attributes: +
org.apache.james.fetchmail.isUserUndefined added to the mail.
+
+
The account tag declares an account on the external server +from which mail should be fetched.
+ +The tag has these attributes: +
+
The alllocal tag declares the parameters to be applied to +dynamic accounts. The set of dynamic accounts is refreshed each time the fetch +task runs by combining the alllocal tag attributes with each of +the currently defined James users to create an account for every James user.
+ +The tag has these attributes: +
+
The property tag declares a name/value pair.
+ +The tag has these attributes: +
+
Full sources to the examples discussed below can be found in the directory
+$PHOENIX_HOME/apps/james/conf/samples/fetchmail.
When all mail for an account is to be delivered to a single user, +configure each account to ignore the recipient in the mail headers and deliver +to the specified recipient. The accounts block looks like +this:
+ +
+
When an account contains mail to be delivered to many users, configure each +account to determine the recipient from the mail headers and deliver to that +user. The accounts block looks like this:
+ +
+
The recipientnotfound tag is used to declare what happens +when the recipient cannot be determined from the mail headers. In the example +below, mail is injected into the spool using the recipient declared in the +account tag:
+ +
+
When an external server supports virtual mailboxes, fetchmail's dynamic +account facility can be used. This greatly simplifies user configuration as +the fetchmail accounts for users are automatically synchronized with those +defined in the James user repository. This guarantees that mail for all local +users will be fetched and delivered.
+ +Currently, there is a limitation that all virtual accounts and the global +account must share the same password.
+ +The alllocal tag declares the parameters for the dynamic
+accounts. The accounts block below will deliver mail for
+user1@external.domain.com to user1@localhost,
+user2@external.domain.com to user2@localhost,
+userZ@external.domain.com to userZ@localhost etc.:
+
The +One Account, One User - Dynamic +example guarantees delivery of mail for all local users, but leaves other mail +on the external server unprocessed. The +One Account, Many Users example +processes all mail on the external server, but cannot guarantee delivery to the +intended recipient. By combining the two, it is possible to guarantee the +delivery of mail for all local users and process all mail.
+ +In the snippet below, the alllocal tag declares dynamic +accounts for all local users and the account tag configures an +account to fetch all mail.
+ +The recipientnotfound tag rejects mail for which a recipient +cannot be determined. By the time this processing is activated, the dynamic +accounts will have processed mail for all local users, so the mail can +only be mail for non-local users or newly arrived mail for local users. It is +not possible to know which, but we want to leave mail for local users to be +dealt with by the dynamic accounts. The next time the dynamic accounts run any +newly arrived mail for local users will be processed. The remainder will be for +non-local users and can now be safely dealt with.
+ +The <recipientnotfound defer="true" attribute
+enables deferal of the processing of messages for which the recipient cannot be
+determined to the next iteration of the fetch task, and is used here. The
+relevant tags are:
+
These are some things to be aware of when using fetchmail: +
FetchedFrom
+matcher to detect mail injected by fetchPOP. This will not work with fetchmail.
+Compared to fetchPOP, there are far fewer occasions when mail injected by
+fetchmail requires special processing. When it does, use the HasMailAttribute
+matcher to match the attribute named
+org.apache.james.fetchmail.taskName to detect all mail injected by
+fetchmail. To detect mail injected by a specific fetch task, use one of the
+HasMailAttributeWithValue matchers to match on the attribute name and the
+attribute value. The attribute value is the name of the fetch task that
+injected the mail.
+markseen="true" will most likely have no effect and
+therefore, the fetchall tag will be inoperative. In this
+situation, the only way to avoid repeatedly fetching the same mail is to delete
+it from the server using leaveonserver="false"/>.
+FetchPOP is being deprecated. +fetchMail provides a superset of +FetchPOP's functionality and is the preferred solution.
+FetchPOP is controlled by a configuration block in the config.xml. +The fetchpop tag defines the boundaries of the configuration block. It encloses +all the relevant configuration for the FetchPOP scheduler. The behavior of the POP service is +controlled by the attributes and children of this tag.
+This tag has an optional boolean attribute - enabled - that defines whether +the service is active or not. The value defaults to "false" if not present.
+The only permitted children of the fetchpop tag are fetch elements. Each of +these fetch tags defines a single FetchPOP task.
+The fetch tag has a single required attribute, name. The name +of each FetchPOP task must be unique.
+In addition to the name attribute, the fetch tag has four +children, all of which are required.
+There are a number of issues which have to be considered when handling fetched mail, such as avoiding circular +routing of mail. Some scenarios are described below with suggested configurations.
+ +This is the intended primary use of FetchPOP.
+If all mail for a domain being fetched is ultimately being handled by this server then it is enough to add
+the domain name as a servername to the servernames section described here.
+
This is the simplest solution and is used where James is being used to redistribute all mail from the
+free catch-all POP accounts provided by many domain registration/hosting companies.
If only part of a domain's mail (perhaps only a single user's POP account) is being handled by this instance +of James it is important that outgoing mail addressed to this domain that is not intended for James be properly delivered.
+To enable this filtering the FetchPOP scheduler adds a header, X-fetchedby, to the fetched message. This header can be checked using +the provided matcher FetchedFrom. This matcher can be used to direct fetched mail to a processor set up +to handle mail fetched from one or more POP3 accounts. The matcher should be used exactly once in the mail +pipeline for each FetchPOP task, as the matcher removes a matching header to prevent outgoing replies or +redirections from looping.
+The FetchedFrom matcher is configured with the name of the particular FetchPOP task it is supposed to match. In general, +this matcher will be used to direct mail to a custom processor for further processing. A mailet tag such as the +following
+where fetchtaskname is the name of the FetchPOP task being matched and fetchprocessor is the name of the fetched mail +processor can be used to this purpose. The fetched mail processor should contain mailets which will filter +and forward mail to real local or remote users. This can be achieved in the usual fashion as described in the +SpoolManager configuration section and in the out of the box +configuration file.
+It is important to note that this first version of FetchPOP does not access the original intended recipient +address of the mail, but instead uses the To: address from the message headers. Since this header may contain an +alias for the intended recipient, or may never have contained the intended recipient address (it could have been +in the Cc: or Bcc: fields) it is possible that James will be unable to deliver the fetched mail. It is intended +that this behaviour be addressed in the next version of James, but in the meantime a catch-all forwarding of +locally undeliverable fetched mail is recommended.
+To handle messages where the intended recipient can be determined but is not present in the To: header, the FetchedFrom +matcher can be used. Place a mailet tag with this matcher between the "RecipientIsLocal" and "HostIsLocal" in the +Transport processor as defined in the out of the box configuration. The mailet tag should be configured to use the +provided ToProcessor mailet to direct fetched mail to a custom processor. Thus all mail fetched by FetchPOP that +could not be trivially mapped to a local user account will undergo further processing, allowing more complex +delivery handling.
+For safety the All matcher should be used at the end of your custom fetched mail processor. This can be used to +catch all mail not handled by previous mailets in the processor. This will enable you to ensure that your +configuration is correct and that any mail not correctly delivered is available for examination by the postmaster.
++The Java Apache Mail Enterprise Server (a.k.a. Apache James) is a 100% pure Java SMTP and POP3 Mail +server and NNTP News server designed to be a complete and portable enterprise mail engine +solution. James is based on currently available open protocols. +
++The James server also serves as a mail application platform. The James project hosts the Apache Mailet API, +and the James server is a Mailet container. This feature makes it easy to design, write, and deploy +custom applications for mail processing. This modularity and ease of customization is one of James' +strengths, and can allow administrators to produce powerful applications surprisingly easily. +
++James is built on top of version 4.1.3 of the Avalon Application Framework. This +framework encourages a set of good development practices such as Component Oriented Programming and +Inversion of Control. The standard distribution of James includes version 4.0.1 of the +Phoenix Avalon Framework container. This stable +and robust container provides a strong foundation for the James server. +
++This documentation is intended to be an introduction to the concepts behind the James implementation, as well +as a guide to installing, configuring, (and for developers) building the James server. +
++I. James Concepts +
+II. How To Build James + +III. How To Install James + +IV. Configuring James +James requires a Java Runtime Environment of Java version 1.3 or higher installed to run the +James application. The exact JREs available depend on the platform. A JRE must be downloaded and +installed before James can run. In addition, the environment variable JAVA_HOME must be set to +the JRE home directory before running James.
++Warning! - Issues have been observed when using Sun's Java 1.3.0 on older Linux +distributions. It is recommended that users of these platforms run James using a more recent +Sun JRE or a JRE produced by an alternate vendor. +
++On Unix platforms, root access will be required to run James. On these platforms, access to ports +below 1024 is generally restricted to the root user. As SMTP, POP3, and NNTP all need to open +server sockets on such ports in standard configurations, James requires root access. +
++Obviously James also requires sufficient disk space, processor power, and network bandwidth. But, +other than what's been discussed here, it has no additional special requirements.
+James installation involves a number of steps, each of which is described in some detail in the +following sections. But as this sequence of steps has confused some users in the past, additional +comments seem warranted.
+It is important to realize that the James configuration files are not unpacked from the James +distribution until the first time James is started. This is a consequence of the design of the +Avalon Phoenix container used to run James. Once James has been started, the distribution will +be unpacked. The server should be stopped, the configuration files edited, and the server restarted.
+So the installation sequence is: 1) Start, 2) Stop, 3) Edit, 4) Restart.
+Obtain the full James binary distribution from the James +release mirrors. Unpack the archive into your James installation directory. Go to the bin subdirectory of the +installation directory and run the "run" script (either run.sh or run.bat, depending on your platform). The configuration +file is now unpacked and available for editing.
+Warning! - James requires Phoenix version 4.0.x to run. There is a known issue with logging in Phoenix 4.0, so version +4.0.1 or higher is strongly recommended. Before attempting to deploy James in a Phoenix container, please make sure +it meets these version criteria.
+Deploying James in Phoenix is fairly easy. Obtain the james.sar file from the James +release mirrors. It can be found in the "Other Binaries" +area of the distribution directory. After downloading the james.sar, +simply place it in the apps subdirectory of your Phoenix installation. Restart Phoenix, and the james.sar should unpack and you +will be ready to configure your James installation.
++After installing the binary, the next step is to adjust the initial configuration. The server should be stopped, and then +configuration can proceed. The most essential configuration is set in the config.xml file. This file can be +found in the apps/james/SAR-INF subdirectory of the installation directory.
+The out of the box configuration makes certain assumptions and has some default values that are unlikely to +be appropriate for real-world servers. There are a few issues that should be addressed immediately upon installation: +
+In addition to adjusting these parameters, you may wish to consult the documentation for a discussion of +common configurations. A list of such configurations, as well as the steps necessary to configure them, can +be found here.
+Once you have edited the configuration file you will need to restart James so that the changes take +effect. When James starts, a list of the James services and the ports on which they are listening should +be displayed on the console. Additional information about the system configuration is printed in the James log files +upon startup.
+Finally, after configuration is complete, it will be necessary to create user accounts before the James server +will be fully operational. Instructions on creating user accounts can be found +here.
+
+ This document explains how to configure sendmail to route all mail generated by /usr/sbin/sendmail or local mail on a host through James on the same host, including mail to local addresses without @host.
+ All sendmail configuration file locations are for Redhat Linux 7.2, other installations may have different locations.
+ We take no responsibility for the quality of the information in this document.
You should back-up any configuration files *before* you alter them.
+
+Ok so you want to use James for everything, including delivering mail from localhost to local users.
+Well the first step is to stop sendmail from starting up as the SMTP Daemon on port 25, otherwise it will route mail to itself and who knows what will happen then.
+Open the sendmail configuration file /etc/sysconfig/sendmail
+Change the line:
+Ok, so far so good, now you need to tell sendmail to relay everything, regardless of its rules, through James. James will take the roles of "local relay" (destination for all unqualified local addresses), "mail hub" (destination for all qualified local addresses) and "smart relay" (destination for all other mail) for this instance of sendmail, thereby catching everything.
+So open /etc/sendmail.cf and..
+
+The developers of sendmail have, wisely, built sendmail in such a way as to prevent, by default, mail being sent by sendmail back to itself, this is done by making a quick check on outgoing mail to see if its destination is our machine. If it is you'll see this message config error: mail loops back to me when you try to send mail.
+But we *want* to relay mail to localhost, and because sendmail isn't receiving our mail, James is, we won't be creating a loop. (make sure you've followed step one though).
+So open /etc/sendmail.cf again and go to the bottom of the file, start scrolling upwards until you see the declaration of the esmtp mailer it'll look something like this
+
+And again, thats it, sendmail will now skip the loopback test on mail leaving through the esmtp mailer.
+
Now you have to make some tests.
Try each of the following, replace names in [] with names of the kind described.
+
+
+SMTP AUTH is a different Kettle of Fish.
+The scenario is that you're using SMTP AUTH on James to restrict SMTP relaying to authenticated users, allowing them to connect from any IP address but still not letting James become an open relay for spam, cool.
+However you now want to let sendmail relay through James, so you need to tell it how to authenticate.
+So open /etc/sendmail.cf again and this time..
+
Thats it, good luck and happy mailing :)
Danny Angus
The Mailet API is a simple API used to build mail processing applications. James is a Mailet +container, allowing administrators to deploy Mailets (both custom and pre-made) to carry out a +variety of complex mail processing tasks. In the default configuration James uses Mailets to carry +out a number of tasks that are carried out deep in the source code of other mail servers (i.e. list +processing, remote and local delivery).
++As it stands today, the Mailet API defines interfaces for both Matchers and Mailets.
+Matchers, as their name would suggest, match mail messages against certain conditions. They +return some subset (possibly the entire set) of the original recipients of the message if there +is a match. An inherent part of the Matcher contract is that a Matcher should not induce any changes +in a message under evaluation.
+Mailets are responsible for actually processing the message. They may alter the message in any fashion, +or pass the message to an external API or component. This can include delivering a message to its destination +repository or SMTP server.
+The Mailet API is currently in its second revision. Although, the Mailet API is expected to undergo substantial changes in the near future, it is our aim that existing Mailets that abided purely by the prior Mailet API interfaces will continue to run with the revised specification.
+ +James bundles a number of Matchers and Mailets in its distribution. Descriptions of provided matchers +can be found here, while descriptions of provided mailets can be found +here.
+One of the frequent questions on the James-User Mailing List is how +to create a mailing list. This document explains one way of using the +currently supplied Matchers and Mailets in James v2.1.
+ +Basically, the process requires creating two <mailet> entries +and a repository. The first mailet handles list commands (currently +only list-name-on and list-name-off). The second mailet +handles list messages. The repository will hold the e-mail addresses +of list subscribers.
+ +The mailets go into the processor chain (e.g., at the top of the +transport processor), the repository goes into the +<users-store> block.
+ +You need to setup two mailets.
+ +The first mailet that you need to setup is an instance of the Avalon Listserv +Manager mailet. This will handle subscribing and unsubscribing. +[Note: the current code does not support confirmed opt-in, just basic +commands.] The CommandForListserv +matcher is used to invoke match messages containing commands for the +mailing list.
+ +The second mailet is an instance of the Avalon Listserv +mailet. That mailet actually receives messages for the list and +causes them to be distributed. The RecipientIs matcher +is used to match messages intended for the mailing list.
+ +The following illustrates the two <mailet> elements that need to be added:
+ +The mailing list mailets need a repository within which to store +the subscriber list. There is a separate repository for each mailing +list, and is completely independent of the user repository used by +James to manage e-mail accounts. This is configured in the +<users-store> block of config.xml.
+ +The following illustrates a database-backed repository using JDBC +with the ListUsersJdbcRepository class. Notice that there will be a +single table, lists, created in the db://maildb resource +defined elsewhere. There are currently two columns: the list name and +the list subscriber.
+ +The following illustrates a file-system repository using the +UsersFileRepository class. [Note: the destination URL is a child +element when configuring a file-system repository, and an attribute +when configuring a database-backed repository. This inconsistency +will be addressed in a future version of James.]
+ +The NNTP service is controlled by a two configuration blocks in the config.xml. These are the nntpserver block and the nntp-repository block.
+The nntpserver tag defines the boundaries of the configuration block. It encloses +much of the relevant configuration for the NNTP server.
+ +This tag has an optional boolean attribute - enabled - that defines whether the service is active or not. The value defaults to "true" if +not present.
+The standard children of the nntpserver tag are:
+There are a few additional children of the nntpserver tag that are appropriate for advanced +configurations. These should only be used by expert administrators. All tags in this group are optional.
+The POP3 service is controlled by a configuration block in the config.xml. +The pop3server tag defines the boundaries of the configuration block. It encloses +all the relevant configuration for the POP3 server. The behavior of the POP service is +controlled by the attributes and children of this tag.
+ +This tag has an optional boolean attribute - enabled - that defines whether the service is active or not. The value defaults to "true" if +not present.
+The standard children of the pop3server tag are:
+There are a few additional children of the pop3server tag that are appropriate for advanced +configurations. These should only be used by expert administrators. All tags in this group are optional.
+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 here.
+ +Description: This mailet adds a text footer to the message.
+Parameters: +
Description: This mailet adds a Habeas warrant mark (see http://habeas.com for details) to the message.
+Parameters: None.
+Description: This mailet adds a text header to the message.
+Parameters: +
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
+Parameters: +
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.
+Parameters: +
Description: This mailet forwards the message to a set of recipients.
+Parameters: +
Description: This mailet does alias translation for email addresses stored in a database table.
+Parameters: +
Description: This mailet does complex alias translation for email addresses stored in a database table.
+Parameters: +
Description: This mailet delivers messages to local mailboxes.
+Parameters: None.
+Description: This mailet forwards the message as an attachment to the James postmaster.
+Parameters: +
Description: This mailet forwards the message as an attachment to the original sender.
+Parameters: +
Description: This mailet ends processing for this mail.
+Parameters: None.
+Description: Intercepts all mails addressed to postmaster@<domain> where <domain> is one +of the domains managed by this James server and substitutes the configured James postmaster address for +the original recipient address. This mailet is inserted automatically by James at the head of the root +processor.
+Parameters: None.
+Description: A mailet providing powerful, configurable redirection services.
+ This mailet can produce listserver, forward and notify behaviour, with the
+ original message intact, attached, appended or left out altogether.
+ This built in functionality is controlled by the configuration as described
+ here.
It is also intended to be easily subclassed to make providing bespoke redirection
+ mailets simple.
+ By extending it and overriding one or more of its methods new behaviour can
+ be quickly created without the author having to address any other issue than
+ the relevant one. For more information see the javadocs
+ here.
Parameters: See javadocs.
+Manages delivery of messages to recipients on remote SMTP hosts.
+Parameters: +
Description: This mailet sends a message to the sender of the original mail message with a server timestamp.
+Parameters: None.
+Redirects processing of the mail message to the specified processor.
+Parameters: +
Places a copy of the message in the specified repository.
+Parameters: +
Description: Ignores the recipients associated with the Mail interface. Instead, it regenerates the +mail recipients from the MimeMessage headers (To, Cc, Bcc) and inserts a new message at the queue root +these new recipients. The original message is GHOSTed.
+Parameters: +
James provides a number of implemented Matchers for use by James administrators in their +configurations. These are primarily matchers that members of the James developer or user +communities have found useful in their own configurations. A description of how to configure +Matchers and use them in the James SpoolManager can be found here.
+ +Description: This matcher is the trivial one - it matches all mails being processed. All recipients are returned.
+Configuration string: None.
+Description: It can be used to refuse emails with SCR, PIF, EXE etc. attachments. +It matches mails that has a file attachment with a file name meeting one of the supplied filters. +All recipients are returned.
+Configuration string: A comma or space delimited list of file names. +File names may start with a wildcard '*'. Example: *.scr,*.bat,*.pif,*.pi,*.com,*.exe
+Description: The CommandForListserv matcher is used as a simple filter to recognize emails that are list server +commands. It will match any email addressed to the list server host, as well as any email that is addressed +to a user named <prefix>-on or <prefix>-off on any host. Only those matching recipients will be returned.
+Configuration string: An email address of the form <prefix>@<host>, where host is the hostname used for the listserver and prefix is the command prefix.
+Description: A matcher intended for use with the FetchPOP server. It matches a custom header (X-fetched-from) that is +set by the FetchPOP server. FetchPOP sets this header to the name of the FetchPOP task which originally fetched +the message. All recipients are returned.
+Configuration string: The name of the FetchPOP task which originally fetched the message.
+Description: Matches those messages with a MIME type of "multipart/mixed". All recipients are returned.
+Configuration string: None.
+Description: Matches mails that have the Habeas Warrant (see http://www.habeas.com for details). All recipients are returned.
+Configuration string: None.
+Description: Matches mails that have the specified header. All recipients are returned.
+Configuration string: The name of the header whose presence determines the match.
+Description: Matches mails that have the specified Mail Attribute. All +recipients are returned.
+Configuration string: The name of the Mail Attribute to match. For example:
+
+<mailet match="HasMailAttribute=name" class="<any-class>">
+
+
+Description: Matches mails that have the specified Mail Attribute and the +specified MailAttribute value. All recipients are returned.
+MailAttributes are types of Object whereas the value specified in the Matcher +condition is of type String. The toString() method is used to obtain a String +representation of the Mail Attribute value for matching. The +String.equals(String) method tests for a match.
+Configuration string: The name of the Mail Attribute to be matched, a comma
+and then the String value to be matched. For example:
+
+<mailet match="HasMailAttributeWithValue=name, value" class="<any-class>">
+
+
+Description: Matches mails that have the specified Mail Attribute and +a MailAttribute value that matches the specified regular expression. +All recipients are returned.
+MailAttributes are types of Object whereas the value specified in the Matcher +condition is of type String. The toString() method is used to obtain a String +representation of the Mail Attribute value for matching. The regular +expression must follow Perl5 syntax.
+Configuration string: The name of the Mail Attribute to be matched, a comma
+and then the regular expression used to match the value against. For example:
+
+<mailet match="HasMailAttributeWithValueRegex=name, regex" class="<any-class>">
+
+
+Description: Matches mails that are sent to email addresses on hosts that are in the configuration list. Only +recipients that are on one of the hosts are returned.
+Configuration string: A list of host names, comma or space delimited.
+Description: Matches mails that are sent to email addresses on local hosts. Only +recipients that are on one of the local hosts are returned.
+Configuration string: None.
+Description: Checks the mail against one of a number of mail-abuse.org IP lists.
+Configuration string: One of three strings - "blackholes.mail-abuse.org", "relays.mail-abuse.org", or "dialups.mail-abuse.org".
+Description: Matches those messages sent to only a single recipient. The single recipient is returned.
+Configuration string: None.
+Description: A matcher derived from a Netscape Mail Server spam filter. If the matcher detects headers that +indicate spam, the message is matched. All recipients are returned.
+Configuration string: None.
+Description: Matches mails that are sent to one of the recipients on a specified list. Only +matching recipients are returned.
+Configuration string: A list of recipient addresses, comma, tab, or space delimited.
+Description: Matches mails that are sent to email addresses on local hosts with users that have local acccunts. Only +matching recipients are returned.
+Configuration string: None.
+Description: Counts the number of Received headers in the mail (each of which represents a server +in the relay chain). If the number equals or exceeds the specified limit, the mail is +matched. All recipients are returned.
+Configuration string: a positive integer that is the limit on the number of relays.
+Description: Checks the remote address from which the mail was received against the configured list. If the address matches one on the list, the matcher considers it a match. All recipients are returned.
+Configuration string: A list of domain names, IP addresses, or wildcarded IP subnets of any class. The +list may be comma or space delimited.
+Description: Checks the remote address from which the mail was received against the configured list. If the address doesn't match one on the list, the matcher considers it a match. All recipients are returned.
+Configuration string: A list of domain names, IP addresses, or wildcarded IP subnets of any class. The +list may be comma or space delimited.
+Description: Matches mails where the host name in the address of the sender cannot be resolved. All +recipients are returned.
+Configuration string: None.
+Description: Matches mails that are sent by one of the senders on a specified list. All +recipients are returned.
+Configuration string: A list of sender addresses, comma, tab, or space delimited.
+Description: Matches emails with a total message size (headers and body) greater than the specified limit. All recipients are returned.
+Configuration string: a positive integer followed by an 'm' or a 'k'. This is the maximum message size permitted specified in megabytes or kilobytes respectively.
+Description: Matches emails with the specified subject. All recipients are returned.
+Configuration string: The string against which mail subject headers are matched.
+Description: Matches emails whose subject header starts with the specified string. All recipients are returned.
+Configuration string: The string against which mail subject headers are matched.
+Description: Matches mails that are sent to email addresses that have userids that are in the configuration list. Only +matching recipients are returned.
+Configuration string: A list of user names, comma or space delimited.
+The RemoteManager is controlled by a configuration block in the config.xml. +The remotemanager tag defines the boundaries of the configuration block. It encloses +all the relevant configuration for the RemoteManager. The behavior of the RemoteManager is +controlled by the attributes and children of this tag.
+ +This tag has an optional boolean attribute - enabled - that defines whether the service is active or not. The value defaults to "true" if +not present.
+The standard children of the remotemanager tag are:
+There are a few additional children of the pop3server tag that are appropriate for advanced +configurations. These should only be used by expert administrators. All tags in this group are optional.
+James uses a number of different repositories to both store message data (email, news messages) and +user information. User repositories store user information, including user names, authentication +information, and aliases. Mail repositories store messages that have been delivered locally. Spool +repositories store messages that are still being processed. Finally, news repositories are used to +store news messages.
+ +Aside from the type of data they store, repositories are distinguished by +where they store data. There are three types of storage - File, Database, and DBFile.
+File-based repositories store all data in the file system. In general, these repositories are extremely +simple to configure, but may compare poorly in terms of performance when compared to other repository +types. File repositories are not recommended for large or performance-critical configurations. In the +default configuration, all repositories are file repositories.
+ +File repository paths typically begin with the prefix "file". Paths are relative to the application +base directory, unless the path begins with a slash. As an example, assume that James is running in +/usr/james/phoenix/apps/james. Then "file://var/mail/spool/" would refer to the directory /usr/james/phoenix/apps/james/var/mail/spool. +And "file:///var/mail/spool/" (note the extra '/') would refer to the directory /var/mail/spool.
+ +All repository types (mail, spool, user, and news) have file-based implementations. No special configuration is required to enable file-based repositories
+ +Database repositories store all data in an administrator-supplied database. Configuration is somewhat +more complex, requiring that the administrator adjust the data-connections section. Detailed directions +are included in the sample configuration file. The administrator will need to know the JDBC driver class, +the appropriate URL for use with his database, and a valid username/password for the database.
+ +If the administrator wants to configure a database other than MySQL, it will be necessary to add the jar +or zip file containing the JDBC driver classes to the lib subdirectory of the installation directory. This +will allow Phoenix to properly load the driver when it is initializing the database repository. The MySQL +driver is pre-packaged with James.
+ +Database repository paths typically begin with the prefix "db". The format is "db://<data-source>/<table>" +where <data-source> is the name of the data-source defined in the data-connections section. And <table> is +the particular table associated with the repository.
+ +Mail, spool, and user repositories have JDBC-based implementations.
+ +This is a special repository type used only for mail repositories. DBFile repositories store the body of +a mail message in the file system, while headers are stored in the database. This allows the administrator +to minimize the size of data stored in the database, while conserving most of the performance of the +database repository.
+ +Only mail repositories have dbfile-based implementations.
+There are a number of global configuration blocks that do not fall into any one +component. They have effects that are global in scope across the server. Some of +these blocks are crucial, while others can be ignored by any but the most sophisticated +server administrators.
+This configuration block is defined by the James tag. All administrators +need to adjust this configuration block upon installation. It no attributes, but several +children, all of which are required. +
+This block controls general connection management. There are two elements. +
This block controls the low level file repository to file mapping. There is no need to modify this.
+This block controls the socket types available inside James. Unless you are intending to enable SSL, it +shouldn't be necessary for you to adjust this block. For modifications to this block that are required to +enable TLS, see the using TLS section.
+This block controls the thread pools available inside James. Only expert administators should modify +this configuration.
+Authenticated SMTP is a method of securing your SMTP server. With SMTP AUTH enabled senders who wish to +relay mail through the SMTP server (that is, send mail that is eventually to be delivered to another SMTP +server) must authenticate themselves to James before sending their message. Mail that is to be delivered +locally does not require authentication. This method ensures that spammers cannot use your SMTP server +to send unauthorized mail, while still enabling users who may not have fixed IP addresses to send their +messages.
+Mail servers that allow spammers to send unauthorized email are known as open relays. So SMTP AUTH +is a mechanism for ensuring that your server is not an open relay .
+At this time James only supports simple user name / password authentication.
+Configuring James for Authentication SMTP is a multi-step process. It requires several adjustments of +the config.xml. To enable SMTP AUTH, do the following:
+First, as mentioned above, SMTP AUTH requires that James be able to distinguish between mail intended +for local delivery and mail intended for remote delivery. James makes this determination by matching the +domain to which the mail was sent against the <servernames> element of the James configuration block. Any +local domains should be explicitly listed as <servername> elements in this section.
+Second, James is configured out of the box so as to not serve as an open relay for spammers. This is done +by restricting the IP addresses from which mail will be accepted using the RemoteAddrNotInNetwork mailet. This +restriction must be lifted before users can send from arbitrary clients. To do this, comment out or remove the +mailet tag containing the class attribute "RemoteAddrNotInNetwork". This tag can be found in the spoolmanager +configuration block, in the root processor configuration.
+Third, set the authRequired element of the smtpserver configuration block to "true".
+Fourth, if you wish to ensure that authenticated users can only send email from their own account, you may +optionally set the verifyIdentity element of the smtpserver configuration block to "true".
+Fifth, restart James. This will pull in all of your configuration changes.
+Finally, you need to verify that your configuration was done correctly. This step is +important and should not be skipped.
+Verify that you have not inadvertantly configured your server as an open relay. This is most easily +accomplished by using the service provided at ORDB.org. ORDB.org will +check your mail server and inform you if it is an open relay.
+It is extremely important that your server not be configured as an open relay. Aside from potential +costs associated with usage by spammers, connections from servers that are determined to be open relays +are routinely rejected by SMTP servers. This can severely impede the ability of your mail server to +send mail.
+Of course it is also necessary to confirm that users and log in and send +mail through your server. This can be accomplished using any standard mail client (i.e. Outlook, +Eudora, Evolution).
+The SMTP service is controlled by a configuration block in the config.xml. +The smtpserver tag defines the boundaries of the configuration block. It encloses +all the relevant configuration for the SMTP server. The behavior of the SMTP service is +controlled by the attributes and children of this tag.
+ +This tag has an optional boolean attribute - enabled - that defines whether the service is active or not. The value defaults to "true" if +not present.
+The standard children of the smtpserver tag are:
+There are a few additional children of the smtpserver tag that are appropriate for advanced +configurations. These should only be used by expert administrators. All tags in this group are optional.
+James separates the services that deliver mail to James (i.e. SMTP, FetchPOP) +from the engine that processes mail after it is received by James. The +SpoolManager component is James' mail processing engine. James' SpoolManager component +is a Mailet container. It is these mailets and matchers that actually carry out mail processing.
+ +Core to the SpoolManager operation are Matchers and Mailets. A Matcher is a +simple object that checks whether a mail message matches a particular condition. +A mailet is another type object that processes an email message in some way. Some +typical tasks appropriate for a mailet would be adding a header, delivering the message +to a local repository, or handling remote delivery. Both the Matcher and Mailet APIs are +public, allowing James users to write their own custom matchers and mailets. James +comes with a large set of pre-built matchers and mailets.
+ +Matchers and mailets are used in pairs. At each stage in processing a message is checked +against a matcher. The matcher will attempt to match the mail message. The match is not simply +a yes or no issue. Instead, the match method returns a collection of matched recipients. If the +this collection of matched recipients is empty, the mailet is not invoked. If the collection of +matched recipients is the entire set of original recipients, the mail is then processed by the +associated mailet. Finally, if the matcher only matches a proper subset of the original recipients, +the original mail is duplicated. The recipients for one message are set to the matched recipients, +and that message is processed by the mailet. The recipients for the other mail are set to the +non-matching recipients, and that message is not processed by the mailet.
+ +More on matchers and mailets can be found here.
+ +One level up from the matchers and mailets are the processors. Each processor +is a list of matcher/mailet pairs. During mail processing, mail messages will be +processed by each pair, in order. In most cases, the message will be processed by +all the pairs in the processor. However, it is possible for a mailet to change the +state of the mail message so it is immediately directed to another processor, and no +additional processing occurs in the current processor. Typically this occurs when the mailet wants to prevent +future processing of this message (i.e. the mail message has been delivered locally, +and hence requires no further processing) or when the mail message has been identified +as a candidate for special processing (i.e. the message is spam and thus should be +routed to the spam processor). Because of this redirection, the processors in the +SpoolManager form a tree. The root processor, which must be present, is the root of +this tree.
+ +The SpoolManager continually checks for mail in the spool repository. When +mail is first found in the repository, it is delivered to the root processor. +Mail can be placed on this spool from a number of sources (SMTP, FetchPOP, a +custom component). This spool repository is also used for storage of mail that is +being redirected from one processor to another. Mail messages are driven through +the processor tree until they reach the end of a processor or are marked completed +by a mailet.
+ +More on configuration of the SpoolManager can be found here.
+ +Much of the power of James lies in the SpoolManager component. Custom matchers and +mailets can be easily developed to address an administrator's particular needs. The +processor tree can easily be configured to sort, filter, and deliver mail based on any +number of criteria. Mail administrators new to James should spend some time learning how +to configure the SpoolManager to meet their needs.
+ +The SpoolManager is controlled by a single configuration block in the config.xml. +The spoolmanager tag defines the boundaries of the configuration block. The behavior of +the SpoolManager, most importantly the routing of mail messages through the processor tree, +is controlled by this block.
+ +The spoolmanager tag has a few simple children. These are:
+The remaining SpoolManager configuration elements are complex enough to require a more in-depth +discussion.
+ +In addition to the child elements discussed above, the SpoolManager tag can have several +processor children. It is these tags and their children that define the processor tree +for the SpoolManager.
+Each processor has a required attribute, name. The value of this attribute must be +unique for each processor tag. The name of a processor is significant. Certain processors are required +(specifically root and error). The name "ghost" is forbidden as a processor name, as it is used to denote +a message that should not undergo any further processing.
+The James SpoolManager creates a correspondance between processor names and the "state" of a mail as defined +in the Mailet API. Specifically, after each mailet processes a mail, the state of the message is examined. If +the state has been changed, the message does not continue in the current processor. If the new state is "ghost" +then processing of that message terminates completely. If the new state is anything else, the message is +re-routed to the processor with the name matching the new state.
+The root processor is a required processor. All new messages that the SpoolManager finds on the spool are +directed to this processor.
+The error processor is another required processor. Under certain circumstances James itself will redirect messages +to the error processor. It is also the standard processor to which mailets redirect messages when an error +condition is encountered.
+The transport and spam processors are two useful, but optional, processors that are included in the out of +the box configuration. These processors include logic for actual mail delivery and spam handling respectively. More +information on these processors can be found in the default config.xml.
+Each processor element has zero or more mailet child elements. Each of these elements describes a +matcher/mailet pair. The ordering of the mailet children is crucial to the configuration, as +it is the order in which pairs will be traversed in the processor.
+It is this mailet element that is at the core of the SpoolManager configuration.
+Consider the following simple mailet tag:
+<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">The mailet tag has two required attributes, match and class.
+The match attribute is set to the value of the specific Matcher class to be instantiated with a an +optional argument. If present, the argument is separated from the Matcher class name by an '='. Semantic +interpretation of the argument is left to the particular mailet.
+The class attribute is set to the value of the Mailet class that is to be instantiated.
+Finally, the children of the mailet tag define the configuration that is passed to the Mailet. The +tags used in this section should have no attributes or children. The names and bodies of the elements will be passed to +the mailet as (name, value) pairs.
+So in the example above, a Matcher instance of RemoteAddrNotInNetwork would be instantiated, and the value "127.0.0.1" +would be passed to the matcher. The Mailet of the pair will be an instance of ToProcessor, and it will be passed the (name, value) +pair of ("processor", "spam").
+James includes a number of pre-packaged Mailets and Matchers. A list of provided Mailets may be found +here. A list of provided Matchers may be found here.
+James is an open source project intended to produce a robust, flexible, and powerful +enterprise class server that provides email and email-related services. It is also designed to +be highly customizable, allowing administrators to configure James to process email in a +nearly endless variety of fashions.
+ +The James server is built on top of the Avalon Framework. The standard James distribution +deploys inside the Phoenix Avalon Framework container. In addition to providing a robust +server architecuture for James, the use of Phoenix allows James administrators to deploy +their own applications inside the container. These applications can then be accessed during +mail processing.
+ +The James server is implemented as a complete collection of servers and related components that, taken together, +provide an email solution. These components are described below.
+ +The POP3 protocol allows users to retrieve email messages. It is the method +most commonly used by email clients to download and manage email messages.
+ +The James version of the POP3 service is a simple and straightforward implementation that +provides full compliance with the specification and maximum compatibility with common +POP3 clients. In addition, James can be configured to require SSL/TLS connections for +POP3 client connecting to the server.
+ +More information on configuring the POP3 service can be found here.
+ +SMTP (Simple Mail Transport Protocol) is the standard method of sending and delivering +email on the internet. James provides a full-function implementation of the SMTP specification, +with support for some optional features such as message size limits, SMTP auth, and encrypted +client/server communication.
+ +More information on configuring the SMTP service can be found here.
+ +NNTP is used by clients to store messages on and retrieve messages from news servers. James provides +the server side of this interaction by implementing the NNTP specification as well as an appropriate +repository for storing news messages. The server implementation is simple and straightforward, but +supports some additional features such as NNTP authentication and encrypted client/server communication.
+ +More information on configuring the NNTP service can be found here.
+ +FetchPOP, unlike the other James components, is not an implementation of an RFC. Instead, it's a +component that allows the administrator to configure James to retrieve email from a number of POP3 +servers and deliver them to the local spool. This is useful for consolidating mail delivered to a +number of accounts on different machines to a single account.
+ +More information on configuring FetchPOP can be found here.
+James separates the services that deliver mail to James (i.e. SMTP, FetchPOP) +from the engine that processes mail after it is received by James. The +SpoolManager component is James' mail processing engine. James' SpoolManager component +is a Mailet container. It is these mailets and matchers that actually carry out mail processing.
+ +More on the structure of the SpoolManager and the Mailet API can be found here.
+ +James uses a number of different repositories to both store message data (email, news messages) and +user information. User repositories store user information, including user names, authentication +information, and aliases. Mail repositories store messages that have been delivered locally. Spool +repositories store messages that are still being processed. Finally, news repositories are used to +store news messages. Aside from what type of data they store, repositories are distinguished by +where they store data. There are three types of storage - File, Database, and DBFile.
+ +James provides a simple telnet-based interface for control. Through this interface you can add +and delete users, configure per-user aliases and forward addresses, and shut down the server.
+ +More on the configuring the RemoteManager can be found here.
+ ++This document explains how to enable James 2.1 services to use Transport Layer Security (TLS) for encrypted client-server communication.
+ +James uses the Sun Java Secure Sockets Extension (JSSE) infrastructure to provide TLS/SSL +sockets. JSSE comes packaged with several vendor Java distributions (i.e. Sun Java 1.4.x, +IBM Java 1.3.x). For these distributions, please follow the vendor provided instructions for +configuring the JVM to use JSSE services.
+ +If you are using a Java distribution that does not include JSSE as part of the +distribution you will need to download the JSSE package separately. It can be obtained from +here. Please follow Sun's instructions for installation +and configuration of JSSE.
+In either case, you will need to statically define a JSSE TLS provider. In general, this +is the default installation.
+Once you've installed JSSE, James still needs to be configured to take advantage of the JSSE +functionality.
+To use TLS/SSL inside James you will need a certificate keystore.
+The out of the box configuration file contains a template for the SSL configuration in place. Specifically, +in the sockets block, under the server-sockets element, there is a commented out factory with the +name "ssl". The first step to configuring the server socket factory is uncommenting out this element.
+The factory element contains several children. Of these, it should only be necessary to adjust two or three children.
+The required file element specifies the location of the keystore to be used by the factory. This is specified +as a file path using Unix-style formatting. The path is taken to be relative to the apps/james/ subdirectory of +the application installation directory unless an absolute path is specified.
+The password element should be set to the keystore password. This password should have been specified +when the keystore was created, and it is required to open the keystore. This value is required.
+Finally, it may be necessary to adjust the type element. This element can take on any keystore type +supported by the JSSE provider being used (see the JSSE documentation for details). The out of the box +configuration specifies JKS (Java Keystore).
+The remaining children should not need to be deleted or adjusted.
+Each of the services - SMTP, +POP3, NNTP, +and RemoteManager - supports use of TLS. Each of +these services has an optional boolean configuration element useTLS which is used to toggle +use of TLS for the service. When this value is set to true, that particular service will use the "ssl" +server socket factory to spawn server sockets.
+After you've configured a particular service to use TLS/SSL connections, the service port +should no longer accept unencrypted TCP/IP connections. This can be tested by using a telnet +client to directly connect to the service port. The telnet connection should simply hang until +the client times out.
++To validate that the port is properly accepting SSL connections an SSL client can be used to +open a connection to the service port. One such client is OpenSSL, available from the +OpenSSL web site. Follow the instructions provided with +the SSL client to create a connection to the service port. Upon connection, the usual +service greeting should appear.
+James has the capacity to use a JDBC-compatible database for storage of both message and user +data. This section explains how to configure James to utilize a database for storage.
+Using James with a database backend has certain requirements. Database configuration is +extremely vendor-specific, so we can only state the requirements in general terms.
+There must be a database instance accessible from the James server. An account with appropriate +privileges (select, insert, delete into tables, and on initial startup creation of tables) and +with sufficient quota for the data to be inserted into the database must be available. Also, +since James will use JDBC to access the database, an appropriate JDBC driver must be +available for installation.
+It is important to verify the functionality of the database before attempting to configure +James to use it as a repository. This will help ensure that configuration issues are properly +identified.
+Configuring the Phoenix container to work with JDBC is the first step in enabling James database support.
+First, Phoenix must be able to load the JDBC classes. To make these classes available to Phoenix, place the +jar/zip files for the JDBC driver in the lib subdirectory of the James installation directory. Any additional +libraries upon which the JDBC library depends that are not part of the standard Java distribution should also be +added to this directory.
+Please note that a MySQL driver is included as part of the James distribution and +so there is no need to add such a driver to the lib directory.
+Second, the config.xml must be modified so that Phoenix initializes the database connections. The relevant +configuration is in the database-connections block. The database-connections tag has only a single child tag, +data-sources. This latter tag is a simple container tag for a number of child elements. It is these child +elements, data-source elements, that define the database connections.
+Each data-source tag has a required attribute, name. This value +must be unique to each data-source element. It is this name that will +be used to specify the database connection in other parts of the config.xml file.
+The data-source element has five children, all of whom are required. +
Generally, you simply configure these entries in the config.xml +file, which are commented, in order to use a database with James. You +would then use the db: or dbfile: prefix instead of the file: prefix +for a particular repository. You are currently free to mix and match +your use of these different storage types for different repositories. +See Repository Configuration for +more details. A sample configuration is described below.
+ +The precise SQL statements used by James to modify and view data stored in the database are specified in +an external configuration file. The sqlResources.xml file +(which can be found in the apps/james/conf directory) is a sample configuration file that contains the SQL +statements used by James. The purpose of each of these statements, as well as the repository with which +they are associated, is documented in situ.
+ +If you are using a SQL database with unusual SQL commands or data types, you may +need to add special entries to this file. The James team +does try to keep sqlResources.xml updated, so if you do run into a +special case, please let us know.
+ +Also, if the database tables are not created a priori, but rather are to be created by James +upon startup, special attention should be paid to the "create table" statements in this file. Such +statements tend to be both very database and very database instance specific.
+The config.xml file has commented out examples for MySQL and +MSSQL data sources, and for each of the standard repositories. For +example, to use MySQL, you would uncomment and adjust the following +data-source element.
+ +You must create the database, in this case named +mail, the user, and assign the user privileges. +You may create the tables before running James or, if you so choose, James +will automatically create the tables it needs. In the latter case the user +must have table creation privileges.
+ +Once the data-source element has been created, it can be referenced elsewhere in the config.xml +file. For example, the following element tells James to use the maildb data-source and dbfile +storage mechanism for the message spool:
+ +The following element tells James to store mailboxes in a the maildb data-source:
+ +The configuration file contains further examples.
+There are some vendor-specific subtleties in using databases with James that have been observed +by some users. These issues (and methods to resolve them) are recorded on the +James FAQ as they are reported. Please consult the FAQ if you encounter any +difficulties.
+