Add this line to your shell startup scripts:
source /course/cs161/startups/cs161studentYour third programming task is to implement an IMAP client in Java. IMAP is a protocol for remote access of email, and is described in RFC 3501. This is a long document, but you should read through it with care.
Your goal in this assignment is to develop a client that will be useful when you develop and test your (future) IMAP server. As such, your focus should be on flexibility, rather than performance. Howevere, since one use your client will be to simulate high loads, performance does matter, and you will, once again, use an event-based architecture to support large numbers of concurrent connections.
To increase the flexibility of you client, you will embed Jython, the Java version of the Python programming language. You should be able to run you program in two ways, in interactive, or batch. In interactive mode, invoking your client will present a command prompt from which IMAP commands can be issued. It will be up to you to design a set of commands that allows the user to exercise an IMAP server interactively. In batch mode, your client will evaluate a file of Jython code. Your command set should be capable of setting up useful test cases, such as a large number of clients, clients operating at different speeds, clients with different mail habits (such as downloading, or refiling messages), and ill-behaved clients.
We have set up an IMAP server for you to test against on pythagoras.ilab.cs.brown.edu, port 145. We hope to add some test accounts, but for now you can begin testing by logging in as yourself, with your normal departmental password
Be aware that you can use telnet as a quick way to explore from the command line. For example, this sequence shows a LOGIN command:
cslab5b:~> telnet pythagoras.ilab.cs.brown.edu 145 Trying 10.116.20.7... Connected to pythagoras. Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS AUTH=LOGIN] pythagoras.ilab.cs.brown.edu IMAP4rev1 2004.352 at Wed, 6 Oct 2004 23:52:05 -0400 (EDT) A0001 LOGIN jj "mypassword" A0001 OK [CAPABILITY IMAP4REV1 LITERAL+ IDLE NAMESPACE MAILBOX-REFERRALS BINARY UNSELECT SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User jj authenticated
You should also read RFC 2683 which contains advice for IMAP developers (clients and servers). It will help you write a better client, but more importantly, it will give you ideas for variant behavior that your client can provide in order to test your server.
Your code will be graded on the following factors (and their weights).
| Documentation and code legibility: | 20% |
| Functionality (non-blocking, error reporting, etc): | 50% |
| Robustness (malicious input, many connections, etc): | 30% |