Prepare James

You should have a James instance readily installed. This means at least extracted James binary and started the server once (see JamesQuickstart).

Edit the configuration file JAMES_HOME/apps/james/SAR-INF/config.xml

Internal test domain

In the server names sections, add new line containing the virtual domain "mail.james.local". This makes James consume all mails addressed to, for example [MAILTO] test@mail.james.local.

It should look something like this, depending on your further configuration preferences:

<servernames autodetect="true" autodetectIP="true">
  <!-- CONFIRM? -->
  <servername>localhost</servername>
  <servername>mail.james.local</servername>
</servernames>
        

Sending external mail

All mail addresses not handled by James are delivered to their intended destination, if possible. For Postage to intercept this and receive all mails send out by James, we must enable gateway forwarding.

change

<gateway> otherserver.mydomain.com </gateway>
<gatewayPort>25</gatewayPort>
        

into

<gateway> localhost </gateway>
<gatewayPort> 2525 </gatewayPort>
        

If Postage is running on another machine than James, you should use the appropriate host/port combination under which Postage is receiving mail.

Now Postage is consuming all mail sent out by James and tries to align the mail it puts into James with mail coming out of the server.

NOTE: This configuration makes James unable to deliver regular external mail, don't do this on a production system!

Enable Postage to record memory and thread resource consumption of James

This is optional configuration.

It only works, if James is run under JSE5 or newer and only if Postage has been build with JMX support. It also conflicts with James' current genuine MX4J-based JMX support, which has to be disabled (see ConfigureJmx how to use JSE5 JMX support).

Edit file <JAMES_HOME>/bin/phoenix.[sh|bat]

Replace line

JVM_OPTS="-Djava.ext.dirs=$JVM_EXT_DIRS"
      

with (on one line)

JVM_OPTS="-Djava.ext.dirs=$JVM_EXT_DIRS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=10201 "