This is a living document that provides answers to common questions about James, installation, configuration, admin and running not already answered in the documentation. Last Updated January 2005.
<mailet match="CommandForListserv=james@localhost"
class="AvalonListservManager">
<repositoryName>list-james</repositoryName>
</mailet>
<mailet match="RecipientIs=james@localhost" class="AvalonListserv">
<membersonly> false </membersonly>
<attachmentsallowed> true </attachmentsallowed>
<replytolist> true </replytolist>
<repositoryName>list-james</repositoryName>
<subjectprefix>JamesList</subjectprefix>
</mailet>
<repository name="list-james"
class="org.apache.james.userrepository.ListUsersJdbcRepository"
destinationURL="db://maildb/lists/list-james">
<sqlFile>file://conf/sqlResources.xml</sqlFile>
</repository>
<repository name="list-james"
class="org.apache.james.userrepository.UsersFileRepository">
<destination URL="file://var/lists/list-james/"/>
</repository>
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
<processor> spam </processor>
</mailet>
<mailet match="RemoteAddrNotInNetwork=127.0.0.1,192.168.1.*"
class="ToProcessor">
<processor> spam </processor>
</mailet>
Please note that if you wish to configure James to allow users to send email from any domain or IP address you will need to disable this matcher. In this situation you must use SMTP AUTH to ensure that your server does not act as an open relay. For more on open relays, please see the Open Relay Database.
You need to do one of two things:
If you want to delve into the code, look at the RemoteDelivery mailet. You may also want to review the mail repository source code for the repository type you are using (file, db, etc...).
IMAP development had been stalled, but has recently attracted new activity. IMAP support is scheduled for inclusion in James v3. In the meantime, there is experimental code in the repository. If you are interested in working on or trying the IMAP prototype code, join the james-dev mailing list and let us know.
James v2.1+ includes a new mailet for database users, JDBCVirtualUserTable, that mimics some of the sendmail capabilities of the same name.
JDBCVirtualUserTable does not provide any administation tools. You'll have to create and maintain the database table yourself. The standard configuration is as follows:
CREATE TABLE VirtualUserTable ( user varchar(64) NOT NULL default '', domain varchar(255) NOT NULL default '', target_address varchar(255) NOT NULL default '', PRIMARY KEY (user,domain) );
The standard query used with VirtualUserTable is:
select VirtualUserTable.target_address from VirtualUserTable, VirtualUserTable as VUTDomains where (VirtualUserTable.user like ? or VirtualUserTable.user like "\%") and (VirtualUserTable.domain like ? or (VirtualUserTable.domain like "\%" and VUTDomains.domain like ?)) order by concat(VirtualUserTable.user,'@',VirtualUserTable.domain) desc limit 1
For a given [user, domain, domain] used with the query, this will match as follows (in precedence order):
<mailet match="All" class="JDBCVirtualUserTable"> <table>db://maildb/VirtualUserTable</table> </mailet>
Virtual hosting is one of the most requested features, and additional work is scheduled for the 3.0 release.
We are largely reliant on what Avalon is doing in terms of classloading, but here are a few tips and suggestions:
Eventually we hope to support mailet reloading and a special lib and classes directory within the james directory that custom mailets can load from, but for now these are hopefully some useful tips.If you remove a block it wont't be loaded next time you restart James. You must also remove all sections related to the removed blocks from the James configuration file - config.xml - otherwise you will get error messages, saying that there is no corresponding block.
Read the "Contributors How To" here
Read the "sendmail How To" here
I am using Microsoft's SQL Type 4 JDBC Driver, why do I get the following exception?
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start manual transaction mode because there are cloned connections.
This seems to be a problem with the Microsoft Type 4 JDBC Driver and concurrent statements/transactions/resultsets on the same database conntection.
To solve this you need to add ;SelectMethod=cursor to the end of your dburl string. Your dburl string would then look something like this
<dburl>jdbc:microsoft:sqlserver://dbserver.host.name:1433;SelectMethod=cursor</dburl>
NOTE: some people have complained about performance when using this option, the alternative is a 3rd party JDBC driver but these are often not free.
When a user tries to send a large message that is close to but not quite at the max message limit the send fails and an exception similar to the following appears in the log:
Sent: 451 Error processing message:
Exception spooling message: Exception caught while storing mail Container:
java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet
from server configuration of 4193280 bytes;
nested exception is:
java.lang.RuntimeException: Exception caught while storing mail
Container: java.lang.IllegalArgumentException: Packet is larger than
max_allowed_packet from server configuration of 4193280 bytes
Because of how the JDBC driver is written, a 25% factor is necessary between the maximum message size and the max_packet_size to prevent the driver from throwing an exception. So if you want a 4MB maximum message size, you need a 5MB max_packet size. Or a 4MB max_packet_size allows only a 3.2MB max message.
First of all read this: ASF Source Code.
Now go to http://subversion.tigris.org/ and download a subversion client.
James subversion repository is at http://svn.apache.org/repos/asf/james/server. Commiters use "https".
You may want to search the web, our dev and user mail archives or our wiki for more information.
Sun's JVM Internet address lookup uses a cache which is unbounded and doesn't time out.
This is obviously not great for a long running process like a mail server so we have introduced a system property networkaddress.cache.ttl that is used by the distributed phoenix start-up scripts, at startup, to override the java 1.4 Security.setProperty("networkaddress.cache.ttl").
By default this is set to 300 seconds.
This workaround will only be present if you use James as distributed. If you use James in any other container, including different versions of Phoenix, you will need to ensure that you make a similar configuration change to allow the internet address cache to perform acceptably.
James 2.3 has this workaround and it requires it to operate acceptably. Future versions of James will continue to have the workaround in place but will *not* require it. This will provide continued support for any mailets which you may deploy from other sources which might continue to use Sun's InetAddress class for DNS resolution.
We are not currently aware of the behaviour of this cache in other JVM implementations, nor of the effect, if any, which this change might have on them
For more on this read defect report JAMES-592 and related defects.