CS 268 - Assignment 2: News/Mail Agent


Given: February 17, 1998
Due: March 3, 1998
Language Options: C, C++, or Java
OS Options: It must run on Solaris 2.5.1

Mail and News are tried and true distribution mechanisms. They are used by millions on people on a daily basis. Your assignment is to develop a simple Mail/News Agent that will display a quick summary of waiting EMail and News articles.

Upon startup, your program should ask questions as to: (1) POP server hostname, (2) POP server username, (3) POP server password, (4) NNTP server hostname, and (5) list of newsgroups to check. The password must be retrieved by the UNIX getpass() C function or a non-echoing equivalent. The number of newsgroups checked may be up to 256. Appropriate error information should be displayed in case of wrong input. For mail, the program should display the number of messages waiting and the total size of all messages (use the STAT command). For news, the program should display the number of articles and the starting article number (use the GROUP command).

Example


$ mn_client
POP server: naur.csee.wvu.edu
POP username: cs268
POP password:
NNTP server: news.wvnet.edu
Newsgroups (1 per line. End with a .)
Newsgroup 1: comp.os.linux
Newsgroup 2: comp.lang.python
Newsgroup 3: .

should produce output similar to this:


Checking mail at naur.csee.wvu.edu for cs268. 
	cs268 has 3 messages (15878 bytes)
Checking news at news.wvnet.edu for 2 newsgroups.
	comp.os.linux has 38 articles (starting with number 2380)
	comp.lang.python has 215 articles (staring with number 15498)
You may use 157.182.194.39 as a working POP server. Username: cstest and password: cstest

Extra Credit

Value: up to +2% onto final grade

For extra credit, provide the option of using APOP for POP. This must be an argument to your program (-a). Hint: use getopt() to parse arguments.

Value: up to +3% onto final grade

For extra credit, provide the option of having mail and/or news print out a list of the articles/messages in a (from, subject) form. The arguments you must support are (-m for printing mail info and -n for printing news info). Hints: For POP, use the TOP command if available. For NNTP, use the XOVER command if available. If the command is not supported by the server, then ignore the argument and print a warning message.


Todd L. Montgomery (revised 02.16.1998)