This document has been deprecated in favor of Bare Metal Project - Java (source).


Setting Environment Variables

Place the following in your .profile or equivalent
export JAVA_HOME=<path to the JDK directory>
export NHIN_D_ROOT=<path to the directory that will contain the nhin-d directory>
export JAMES_ROOT=<path to the directory that will contain James instances>
OS X: JAVA_HOME is: /System/Library/Frameworks/JavaVM.framework/Home
*nix JAVA_HOME is: /usr/lib/jvm/java-6-sun

Java Cryptographic Extensions

Download and install the JavaMail API.
Unzip the resulting files, and place the jar files in $JAVA_HOME/jre/lib/ext, or, for OS X, $JAVA_HOME/lib/ext
sudo cp lib/*.jar $JAVA_HOME/jre/lib/ext

Check out and build the source code

hg clone nhin-d
cd nhin-d/java
mvn clean install

Install the James instance

NOTE: For this, and other sections, substitute curl -O for wget on OS X, or if your platform doesn't have wget.
mkdir /tmp/stage
cd /tmp/stage
tar xvfz apache-james-2.3.2.tar.gz
rm apache-james-2.3.2.tar.gz
mv james-2.3.2/ $JAMES_ROOT/james_xd

Configure James

cd $JAMES_ROOT/james_xd/
chmod +x bin/
chmod +x bin/
sudo -E ./bin/
sudo mkdir apps/james/SAR-INF/lib

Install the XD* JARs

sudo cp $NHIN_D_ROOT/nhin-d/java/xdmail/target/xdmail-1.0-SNAPSHOT.jar $JAMES_ROOT/james_xd/apps/james/SAR-INF/lib/
sudo cp $NHIN_D_ROOT/nhin-d/java/xd-common/target/xd-common-1.0-SNAPSHOT.jar $JAMES_ROOT/james_xd/apps/james/SAR-INF/lib/

Install Dependencies

cd $JAMES_ROOT/james_xd/apps/james/SAR-INF/lib/
sudo wget
sudo wget
sudo wget
sudo wget
sudo wget
sudo wget

Get supporting configuration files

sudo wget -O $JAMES_ROOT/james_xd/apps/james/SAR-INF/config.xml

Start James and Jetty

You may need to start multiple terminal/command line sessions to run each instance.
If you are using unix you can launch each process in the background by adding the & character to the end of the command.

You can optionally deploy the xd.war ($NHIN_D_ROOT/nhin-d/java/xd/target/xd.war) to a Tomcat 6 instance (or equivalent).
Start James
Start Jetty
cd $JAMES_ROOT/james_xd
sudo -E ./bin/
cd $NHIN_D_ROOT/nhin-d/java/xd
mvn jetty:run-war

Create James users

telnet localhost 4555
> root
> root
> adduser bob password
> quit

Send a test message

TODO: document smtp-cli installation.
smtp-cli --verbose \
         --host localhost \
         --port 25 \
         --force-ehlo \
         --from \
         --to **** \
         --subject "Message subject here" \
         --body-plain "This is the message body" \
         --attach DOCUMENT.xml@text/xml

Verify Step-Up


Verify Step-Down


Verify Relay


Supporting Files