* Copy %jamesdirhere%\conf\wrapper.conf to %jamesdirhere%\bin\ * Then, from a command line, execute: wrapper.exe -i wrapper.conf

Alternatively leave wrapper.conf where it is and tell wrapper.exe where it is: * %jamesdirhere%\bin\wrapper.exe -i %jamesdirhere%\conf\wrapper.conf


For Red Hat

Add the following two lines to the start of to make it chkconfig friendly ( lives in james/bin):

#chkconfig: 2345 80 05
#description: James Mail Server

Then add the following line (also to to set the JAVA_HOME value

export JAVA_HOME=/usr/java/j2sdk/

The first three lines of are now

#chkconfig: 2345 80 05
#description: James Mail Server
export JAVA_HOME=/usr/java/j2sdk/

Add a symbolic link to the james start up script (

cd /etc/init.d
ln -s /opt/james-2.3.1/bin/ james

Then, add james as a service

chkconfig --add james

Then, start the service

service james start

And test:

telnet localhost 25

Wrapper Instructions

The wrapper instructions are found at

I had to edit to set the PHOENIX_HOME (somewhere near the top)


and comment out the bit of

 #PRGDIR=`dirname "$THIS_PROG"`
 #PHOENIX_HOME=`cd "$PRGDIR/.." ; pwd`
 #unset THIS_PROG
 #if [ -r "$PHOENIX_HOME"/bin/ ]; then
    1.  . "$PHOENIX_HOME"/bin/

then very briefly I did this:

 ln -s /home/telrock/apps/james/bin/ /etc/init.d/james
 update-rc.d james start 21 2 3 4 5 . stop 19 0 1 6 .

Update for Mandrake Linux

If you're running Mandrake or any distro that uses config files in the /etc/rc.d/init.d directory, there're two much simpler ways. Well, two ways of doing the same thing actually. The first is to create a file in the /etc/rc.d/init.d directory called james with the following contents (remember to replace /home/james/james with the actual location of your james installation):

 # description: JAMES Mail Server
 # chkconfig: 2345 99 00

 case "$1" in
         /home/james/james/bin/ start
         touch /var/lock/subsys/james
         /home/james/james/bin/ stop
         rm -f /var/lock/subsys/james
         echo "Usage: $0 { start | stop }"
 exit 0

Alternatively, if you've got webmin installed, go to the system section and select "Bootup and Shutdown". Near the top of the page you'll see a link to create a new bootup and shutdown action. You can use that to create a service that's run at startup and shutdown. Just specify the comand:

 /home/james/james/bin/ start

in the box where it asks you for the bootup commands, and specify this command in the box where it asks for the shutdown commands:

 /home/james/james/bin/ stop

That should be it. You can test it by running

 /etc/rc.d/init.d/james start

to start and

 /etc/rc.d/init.d/james stop

to stop it.

Mac OS X

These instructions work on Mac OS X 10.2 and 10.3. I haven't tested them on 10.1.

Install James Most OS X services like James are stored in /Library, so a good place to store it would be /Library/James. You may want to follow the advice of storing the distro in /Library/James/james-2.x and then creating a soft link to it with this command:

 ln -s /Library/James/james-2.x /Library/James/Home

This creates the path /Library/James/Home, which leads you to the james-2.x directory. When a new version comes out, simply install james-3.x in /Library/James, delete the Home link and recreate it with the above command so that it points to james-3.x. This will save you from having to edit the startup scripts later.

StartupItems Mac OS X looks in /Library/StartupItems for services to start up at boot time. Go to this directory, and create it if it's not already there. Inside this dir, create another one named 'James'. The spelling and capitalization are important.

Next, create these two files in /Library/StartupItems/James:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
  <string>Apache James Mail Server</string>
      <string>Starting Apache James Mail Server</string>
      <string>Stopping Apache James Mail Server</string>

These preferences provide the OS with hints as to when James should be started. OS X 10.2 needs James to start at the end of the boot process, or very near the end, so the OrderPreference key provides this hint. I am not sure what other service James depends on that requires this key, but this solved the problem for 10.2. OS X 10.3 doesn't need it to start last, so if you need James to start earlier for some reason, you can set it to None.


# Apache James Mail Server

. /etc/rc.common

StartService ()
    ConsoleMessage "Starting Apache James Mail Server"
    ${PHOENIX_HOME}/bin/ start
    ConsoleMessage -S

StopService ()
    ConsoleMessage "Stopping Apache James Mail Server"
    ${PHOENIX_HOME}/bin/ stop
    ConsoleMessage -S

RestartService ()
    ConsoleMessage "Restarting Apache James Mail Server"
    ${PHOENIX_HOME}/bin/ restart
    ConsoleMessage -S

export JAVA_HOME=/Library/Java/Home
export PHOENIX_HOME=/Library/James/Home

RunService "$1"

This 'James' file needs to be marked as executable, which can be set with this command:

 chmod 755 /Library/StartupItems/James/James

You are now ready to restart your Mac OS X box and have James start up automatically. After booting, you can control James using Apple's SystemStarter command:

 sudo SystemStarter stop James
 sudo SystemStarter start James
 sudo systemStarter restart James

These commands start, stop and restart James. They need to be run with 'sudo' so James can open it's listener ports.

RunAsService (last edited 2009-09-20 22:58:36 by localhost)