IMSP Version 1.1 alpha release
------------------------------
This is an alpha release of IMSP.  Absolutely no warranties of any
kind apply.  Any of the code could completely change.  The
specifications could change.  It may not compile on some systems, as
only some effort has been made yet in the direction of portability.
If you do compile it on another system, please send me the changes you
had to make.  Comments, bug-reports and suggestions are welcome --
send them to chrisn+@cmu.edu.

NOTE
----
The IMSP server is *not* an inetd client.  It is a stand-alone daemon.

COMPILING OPTIONS
-----------------
The DEBUG option disables forking of the server to assist in debugging
the server as well as turning on a few extra messages from the server.
The ANONYMOUS_LOGIN option permits the user "anonymous" to login with
any password.

FILES OF INTEREST
-----------------
Makefile             -- May need to change compiler options and
                        library locations
imsp.implementation  -- Document describing implementation details
option.registry      -- Registered option names as of last update
options.sample       -- Sample options file to copy to /var/imsp/options

SETTING UP
----------
You have to create the directory /var/imsp, or change the "PREFIX"
definition in the syncdb.c file to an appropriate existing directory.

cyrus-imspd must be run as root to use port 406 and for access to
/etc/srvtab for kerberos authentication.

If you want to be able to LOGIN to the server, you should copy the
"options.sample" file to /var/imsp/options once you've changed them as
appropriate for your site.  Without the "imsp.create.new.users"
option, nobody can login without a pre-existing directory and options
file.  The parenthesized lists in the options file are space separated.

If you're using kerberos you need to create a "imap.<hostname>"
kerberos instance where <hostname> is the first element of the host
(e.g. imap.cyrus for cyrus.andrew.cmu.edu).

The CREATE/DELETE/RENAME and new user LOGIN commands do proxy
connections to an IMAP server.  You need to make sure the
"imap.new.mailbox.servers" option is correct for new user LOGIN to
find a server to get a list of mailboxes from.  In addition, if your
IMSP clients are using kerberos tickets rather than plaintext
passwords, you need to modify your IMAP server to accept the
imap.<imsp-hostname> ticket as valid for any user.  AFS sites may need
to start imspd after running pagsh to prevent ticket confusion, and
other sites may need to modify the ticket file environment variable.

If you are running a cyrus imap server, you can remove the file
/var/imsp/mailboxes to cause an automatic re-sync of the mailbox list
with the IMAP server the next time IMSP is restarted.  The mailbox
commands will not work with a c-client IMAP server.

TESTING IT
----------
The test program "imtest" included with this release is a simple
protocol tester.  It connects to the IMSP/IMSP server specified on the
command line, line-buffers user input and sends it to the server as
well as displaying server responses locally.  It can login for you,
and will convert all newlines to CRLF pairs.  To start imtest, you do
the following:
	imtest [login_options] <hostname> <port>

Where <hostname> is the host you wish to connect to, and <port> is the
port name or number.  For <port> you can use "406" for imsp, or if you
add the following line to /etc/services:

imsp            406/tcp                 #Interactive Mail Support Protocol

you can just use "imsp" as <port>.  The login_options are as follows:
	-p		Login with plaintext password
	-k		Login with kerberos
	-ki		Login with kerberos and integrity protection
	-kp		Login with kerberos and privacy protection

IMPLEMENTATION STATUS
---------------------
LOGIN/LOGOUT		Done
NOOP			Done
SUBSCRIBE/UNSUBSCRIBE   Done, except for external mailbox/bboard
			support and shared mailbox support
CREATE			Done, but no replication support
DELETE			Done
RENAME			Done
MOVE			Not Done
AUTHENTICATE		Done, KERBEROS_V4 supported
CAPABILITY		Done
LIST			Done
CREATEADDRESSBOOK	Done
DELETEADDRESSBOOK	Done
RENAMEADDRESSBOOK	Done
GET/SET/UNSET		Done
SEARCHADDRESS		Done
FETCHADDRESS		Done
STOREADDRESS		Done
DELETEADDRESS		Done
LOCK/UNLOCK		Done
SETACL/DELETEACL/
GETACL/MYACL		Done

This meets minimal protocol compliance standards outlined in the IMSP
specification.

C FILES (FOR THE CURIOUS)
-------------------------
imsp_server.c -- parses IMSP protocol received from the client and responds
                 appropriately.
main.c        -- main program which listens on a socket waiting for clients
                 to connect.

authize.c     -- authorization module
abook.c       -- address book support
bb.c          -- support for global mailboxes
option.c      -- support for options database
alock.c       -- support for advisory locking database

imap_client.c -- IMSP's IMAP client routines for proxy connections
login_krb.c   -- kerberos authentication routines
login_unix.c  -- unix authentication routines
proxy_krb.c   -- kerberos proxy login
proxy_unix.c  -- unix proxy login
syncdb.c      -- low level key-value database functions

im_util.c     -- IMSP/IMAP protocol utility functions
dispatch.c    -- File writing/reading with provisions for
                 handling of multiple streams simultaneously.
                 Also includes optional protection mechanism.

adate.c       -- RFC 822 date generator

TELEMETRY
---------
If you wish to save session telemetry on the server, create the
directory "/var/imsp/log/<user>".  All connections by <user> will
store a telemetry log in that directory.

TODO
----
* add API for external address book
* better logging

HISTORY
-------
Version 1.0 alpha 2 released.
 Fixed bug in renaming INBOX.
 Change address book key from atom to string.
 Added advisory locking commands.
Version 1.0 alpha 3 released.
 Added ? wildcard.
 Changed syntax SEARCHADDRESS unsolicited reply.
Version 1.0 alpha 4 released.
 Changed MYACL to MYRIGHTS
 fixed SEARCHADDRESS bug
 fixed bug with "+ go" sending a NULL
 fixed memory bug in kerberos plaintext-password routines
Version 1.0 alpha 5 released.
 Added ADDRESSBOOK command
 fixed bug in lcase() routine.
 Renamed standard options to fit option naming conventions.
Version 1.0 alpha 6 released.
 Added CREATEADDRESSBOOK, DELETEADDRESSBOOK, RENAMEADDRESSBOOK
 Permit empty address book entries and empty address books
 Remove addressbook auto-create on STOREADDRESS
 Remove addressbook auto-delete on STOREADDRESS/DELETEADDRESS
 Added ANONYMOUS_LOGIN option
Version 1.0 alpha 7 released
 Added CAPABILITY command.
 Added AUTHENTICATE command.
 Merged with libcyrus.a
 Added protection support and buffering to dispatch.c
 Added proxy support via AUTHENTICATE command
 Removed old @KERBEROS hack
 Removed old FIND ALL.ADDRESSBOOKS command
 Updated atom definition
 Fixed bug in MYRIGHTS MAILBOX and GETACL MAILBOX
Version 1.0 alpha 8 released. (June 14, 1994)
 Fixed bug in sdb_delete which caused DELETEADDRESSBOOK to break on some
  systems.
 Fixed bug in encoding routines on little-endian machines
 Fixed bug in synchronized database routines which cause RENAMEADDRESSBOOK
  to break on some systems.
 Fixed bug which prevented locking of address book entries with a
  space in their name.
 Fixed bug which caused imap_wait() to lock on connection failures
 Added a number of POSIX compatability changes
 Disown parent tty
 Added some function prototypes
 Added new LIST command and re-write mailbox support
 Changed addressbooks to use libcyrus ACLs in abooks file
 Added \Marked and \Unmarked and LAST/SEEN support
 General cleanup of unused variables, etc.
 Added telemetry log
Version 1.1 alpha released (sync version numbers with cyrus IMAP server)
