Kohei Nozaki's blog 

Configuring Apache James to use PostgreSQL as the backend

Posted on Sunday Apr 19, 2015 at 09:37PM in Technology

UPDATE: I’m running into a strange problem of using PostgreSQL as backend with Thunderbird. I recommend to use an other database as the backend at the moment. http://www.mail-archive.com/server-user%40james.apache.org/msg14715.html

UPDATE2: I created a patch to solve the issue and it seems fine. for detail and download the patch see: https://issues.apache.org/jira/browse/MAILBOX-228

I have been used Apache James with Embedded Derby, but its CPU/IO consumption is increasing day by day. I’m not sure where is the bottleneck but I decided to move to PostgreSQL as its backend anyway.

  1. Put JDBC driver (I used postgresql-9.3-1100.jdbc41.jar) into $JAMES_HOME/conf/lib

  2. Create james-database.properties from template, and put it into $JAMES_HOME/conf as follows

  3. Restart James instance

  4. Create domains, addresses and aliases:

    ./james-cli.sh -h localhost -p 9999 adddomain example.org
    ./james-cli.sh -h localhost -p 9999 adduser kyle@example.org ***
    ./james-cli.sh -p 9999 -h localhost addaddressmapping postmaster example.org kyle@example.org


This guide claims that setting standard_conforming_strings=off is needed, but I guess this issue may address this problem, so I don’t use this setting at the moment. my James installation is shipped with openjpa-2.2.1.jar and the issue was fixed in 2.2.0.


Nice Article.
I am also thinking to migrate my blog to apache, what is it memory foot print ? can it be run on 512 MB (VPS plan )RAM or need more memory to just start out ?

Posted by Amit Joshi on April 21, 2015 at 01:46 AM JST #

Hi Amit, thanks for the comment.

Do you mean Apache Roller (the blog software which used on this blog)? I think it will work fine on 512MB RAM. there's a fine-running blog that powered by Roller running on OpenShift free tier which has 512MB RAM, it has a separate gear for a MySQL instance though. see http://web-gmazza.rhcloud.com/blog/entry/apache-roller-on-openshift for details.

As to my situation, I have running Apache James (mail server software, I mentioned in this entry), WildFly (Java EE 7 Web Profile, deployed Apache Roller and some apps) and PostgreSQL on a Linux VPS which has 1GB RAM (swappiness is 60), it keeps swapping about 500MB, so it looks like insufficient a little.

Posted by Kyle on April 21, 2015 at 08:27 AM JST #

Thanks for your reply.

Posted by Amit Joshi on May 05, 2015 at 07:45 AM JST #

Leave a Comment

HTML Syntax: NOT allowed