Introduction
------------
This document describes the protocol employed by mlmmjadmd.
Implementing a client should not be difficult, if you are 
even modestly used to network programming. Take a look at the 
existing client, if you need inspiration.

Protocol
--------

Any command found not to be matching this regular expression
^[a-z0-9\-@\. ]*$
will be rejected. So will commands matching this regular expression:
.*\.\..*

A command has this form:
<command> <arg1> <arg2> <arg3> ... <argN>\n
Tokens are separated by whitespace. Tokens may not contain 
spaces. Commands are terminated by a newline character.
Any command will result in returned data. Commands are 
handled strictly sequentially for any one TCP connection.

It should be noted that the authenticate command must be successfully 
used before any other commands will be processed.

Returned data takes one of two forms:
1) Commands that return 
   data (ie. listlists, listsubscribers, etc.) result in data 
   adhering to the following format being written back to the 
   TCP channel.
   LI <number of lines of data>\n
   DA <data line 1>\n
   DA <data line 2>\n
   ... 
   DA <data line 3>\n
   OK <Status message>\n
   Each data line will contain a single data item. In the case of 
   the listlists command, data will be list names, whereas in the 
   case of the listsubscribers, listmoderators, etc. commands 
   data will be email addresses.
   The final <status message> can be arbitrarily long, and will 
   contain a free text status message.
2) Commands that return no data (ie. addmoderator, removesubscriber, etc.).
   These commands result in data of the following format being sent 
   back to the client:
   <Status code> <Status message>\n
   The <Status code> is one of ER or OK, with ER meaning that an 
   error has occurred, and OK meaning that the requested action was 
   successfully carried out.
   The <Status message> is a free text description of the <Status code>. 
   It is particularly relevant in the case of an ER <Status code>.


The following is a list of valid commands.
Parameters are in <>. All parameters are required.
Descriptions are in []

authenticate <username> <password>				[Attempt to authenticate <username> with <password>]

listlists										[List all mlmmj lists]
addlist <list name>								[Create a new list named <list name>]
removelist <list name>							[Remove list named <list name>]

listdigestsubscribers <list name>				[List digest subscribers for <list name>]
adddigestsubscriber <list name> <subscriber>	[Add <subcriber> as digest subcriber to <list name>]
removedigestsubscriber <list name> <subscriber>	[Remove <subscriber> as digest subcriber from <list name>]

listsubscribers <list name> 					[List all subscribers on <list name>]
addubscriber <list name> <subscriber>			[Add <subscriber> as a subscriber to <list name>]
removesubscriber <list name> <subscriber>		[Remove <subscriber> as a subscriber from <list name>]

listmoderators <list name>						[List moderators for <list name>]
addmoderator <list name> <moderator>			[Add <moderator> as a moderator for <list name>]
removemoderator <list name> <moderator>			[Remove <moderator> as a moderator from <list name>]

setmoderated <list name>						[Make <list name> moderated]
unsetmoderated <list name>						[Make <list name> unmoderated]

setclosedlist <list name>						[Make <list name> a closed list]
unsetclosedlist <list name>						[Make <list name> an open list]

settocc <list name>								[Enable tocc tunable for <list name>]
unsettocc <list name>							[Disable tocc tunable for <list name>]

setsubonlypost <list name>						[Make <list name> a subscribers only list]
unsetsubonlypost <list name>					[Make <list name> open to non subscribers]

setprefix <list name> <prefix>					[Add subject prefix <prefix> to <list name>]
unsetprefix <listname>							[Remove any prefix from <list name>]

addowner <list name> <owner>					[Add <owner> as an owner for <list name>]
removeowner <list name> <owner>					[Remove <owner> as an owner for <list name>]

addcustomheader <list name> <header>			[Add <header> as custom header for <list name>]
removecustomheader <list name> <header>			[Remove <header> as a custom header for <list name>]

adddelheader <list name> <header>				[Make <header> a deleted header for <list name>]
removedelheader <list name> <header>			[Remove <header> as a deleted header from <list name>]

MORE TO COME. Please refer to the MlmmjCommandHandler class for a complete list.