Question: The big picture here is that you will write two simple programs: One that acts like a basic POP3 server and one that acts like
The big picture here is that you will write two simple programs: One that acts like a basic POP3 server and one that acts like a simple POP3 client. Your programs do not have to implement the full POP3 spec, but all of the behavior is inspired by it. 1 The Setup You will write two programs. The server should run forever, listening for TCP requests. When the request arrives, a conversation between the POP server and the POP client will occur (please check out the example in the course slides). See Section 2 for a complete list of commands the server must support. After the QUIT command, the TCP connection should be closed and the server returns to listening for new connections. The client will be an interactive program, rather than the behind the scenes behavior of a real email client. The user should be prompted to type any of the commands listed in Section 2. For simplicity, let all of the emails exist as separate plaintext files (This eliminates the nastiness of file pointers or figuring out some way to build a custom message store). Posted with this assignment are three plaintext (RFC 5322) emails. Upon starting up, the server should detect that these files exist and respond to the clients queries based on this information. For example, if the client issues the LIST command, the server should report those three emails and their respective sizes. A DELE command should have the effect of truly deleting that message from the store (i.e., deleting the file). If I fire up the client again, deleted messages should not be available for download again. The client is only truly responsible for getting the email and saving it locally. You do not need to display them (unless you would like some extra points see Section 6). After a session communicating with the server, the client should exit. 2 Some Details Your server should be listening on a port number that is passed as a command-line argu- ment (e.g., ./server 5000). If you want, you can use a default value if nothing is passed
on the command line. If you are developing on library machines, there is a possibility that two servers may try to use the same port. To reduce this possibility, use the last four digits of your M-number (provided they are greater than 1024). This has historically worked pretty well. The client should be passed the IP address and port of the server as command line arguments (e.g., ./client localhost 5000). The program should accept localhost or a numeric IP address. The server should support the following POP3 commands (check out the meaning of each command in the course slides): STAT LIST RETR
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
