Overview
A Java class to shutdown Apache James Mail Server via TCP/IP. It shuts down Apache James Mail Server by passing shutdown command via simulated telnet session.

Background
Apache James mail server requires a telnet session (where you pass the shutdown command) for clean shutdown.
BTW: Apache James Mail server has a shoddy documentation which doesn't mention a way to shutdown the server in any intuitive location. You have to really hunt it down.

However without clean shutdown you cannot have config.xml file and hence cannot modify it to your needs. Ctrl-C shutdown for some inexplicable reason deletes the file.

There is a utility floating around on the net which didn't download properly for me. Also it isn't configurable. So I thought of creating a simple configurable utility for my needs.

Download
Download Apache James Mail Server Shutdown Utility.

Error handling
The program terminates with error code 1 on error. A terse message indicating the error is displayed on console (System.out).

Options
Specify the host; default localhost
-Dhost=hostname

Specify the port; default 4555
-Dport=portnumber

Specify the login; default root
-Dlogin=login

Specify the password; default root
-Dpassword=password

Options are used to override the default values.

Usage
Simple:
java JamesShutdown

Configure it:
java -Dhost=foobah.com -Dlogin=foo -Dpassword=bah JamesShutdown