Question: Q2. Mail system (70%). Improve the mail system project to enable to send email to users on another mail server. The project code mail-system can

Q2. Mail system (70%).

Improve the mail system project to enable to send email to users on another mail server. The project code "mail-system" can be found in the chapter 3 in the course project folder.

  • Verify that the original project is unable to send emails between servers. Open this project in BlueJ, create two mail servers and also create two users on server 1, and a third user on server 2. Send two messages from user 1 to user 2 (on server 1) and user 3 (on server 2), respectively. Check whether user 2 and user 3 can receive the message. Youll find user 2 can receive the message, but user 3 cant. Read through the source code and find out why. Write your explanation.
  • Improve the project to enable sending emails between users on different servers. Copy the project files folder to a new folder named mail-system-v2 and program based on this folder. Hints: In order to send emails across servers, youll also need to send a copy of the message to the mail server of the receiver. One way to achieve this is to also post the message item to the destination mail server in the method sendMailItem in the class MailClient. The signature of the method sendMailItem should be changed to public void sendMailItem(MailClient to, String message), that is when your send a message, choose the mail client object instead of the String of user name. Also, in the class MailClient, add two getters (getServer and getUser) to return mail server object and user name respectively. In class MailServer, change the type of the parameters who in methods howManyMailItems and howManyMailItems. Lastly, in class MailItem, change the type of members from and to from String to MailClient. Modify print method to be able to print reasonable information.
  • Repeat the similar testing procedure in step 1), see how it works.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!