0% found this document useful (0 votes)
87 views

Software Requirements Specification: Version 1.0 Approved

This document provides an overview of a Java mail server project. It discusses client/server communication using TCP/IP protocols like TCP and UDP. It describes the basic components of an email server including SMTP, POP, and IMAP protocols. It also provides a high-level introduction to the Java Mail Server project, which implements a multi-threaded socket class to enable reliable communication between clients and servers for applications like chat.

Uploaded by

Uday Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Software Requirements Specification: Version 1.0 Approved

This document provides an overview of a Java mail server project. It discusses client/server communication using TCP/IP protocols like TCP and UDP. It describes the basic components of an email server including SMTP, POP, and IMAP protocols. It also provides a high-level introduction to the Java Mail Server project, which implements a multi-threaded socket class to enable reliable communication between clients and servers for applications like chat.

Uploaded by

Uday Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Software Requirements

Specification
for

<Mail Composer>
Version 1.0 approved

Prepared by:

<Anmol Jain>

<Uday Singh>

<Deepanshu Gupta>

.
Table of Contents

Topic Page No.


S.
no
1 Certificate -

2 Acknowledgements -

3 List of Tables/Figures/Symbols -

4 Chapter-1: Introduction

5 Chapter-2: System Requirements Analysis

6 Chapter-3: System Design

7 Chapter-4: System Development

8 Chapter-5: Summary and Conclusions

9 References/Bibliography

.
1. Introduction

Client/Server Communication
At a basic level, network-based systems consist of a server , client , and a media for communication.
computer running a program that makes a request for services is called client machine. A computer
running a program that offers requested services from one or more clients is called server machine.
The media for communication can be wired or wireless network.

Generally, programs running on client machines make requests to a program (often called as
server program) running on a server machine. They involve networking services provided by the
transport layer, which is part of the Internet software stack, often called TCP/IP (Transport
Control Protocol/Internet Protocol) stack, shown in Fig. 13.2. The transport layer comprises two
types of protocols, TCP (Transport Control Protocol) and UDP (User Datagram Protocol). The
most widely used programming interfaces for these protocols are sockets.

TCP is a connection-oriented protocol that provides a reliable fl ow of data between two


computers. Example applications that use such services are HTTP, FTP, and Telnet.

UDP is a protocol that sends independent packets of data, called datagrams, from one computer to
another with no guarantees about arrival and sequencing. Example applications that use such
services include Clock server and Ping.

The TCP and UDP protocols use ports to map incoming data to a particular process running on a
computer. Port is represented by a positive (16-bit) integer value. Some ports have been reserved to
support common/well known services:

.
 ftp 21/tcp
 telnet 23/tcp
 smtp 25/tcp
 login 513/tcp
 http 80/tcp,udp
 https 443/tcp,udp

User-level process/services generally use port number value >= 1024

Server Socket Class: The java.net.ServerSocket class is used by server applications to obtain a
port and listen for client requests

1.2 Email Server Architecture


The mail server infrastructure consists of several components that work together to send,
relay, receive, store, and deliver email.
The mail server workload uses the following Internet standard protocols for sending and
retrieving email:

Simple Mail Transfer Protocol (SMTP): the Internet standard protocol for sending email.

Post Office Protocol (POP): an Internet standard protocol for retrieving email.

Internet Message Access Protocol version 4 (IMAPv4): an Internet standard protocol for
retrieving email.

.
A Simple E-mail Server: Working

Given that you have an e-mail client on your machine, you are ready to send and receive e-mail.
All that you need is an e-mail server for the client to connect to. Let's imagine what the simplest
possible e-mail server would look like in order to get a basic understanding of the process. Then
we will look at the real thing.

If you've read How Web Servers Work, then you know that machines on the Internet can run email
application that act as servers. There are Web Server FTP servers, telnet servers and email servers
running on millions of machines on the Internet right now. These applications run all the time on
the server machine and they listen to specific ports, waiting for people or programs to attach to the
port. The simplest possible e-mail server would work something like this:

1. It would have a list of e-mail accounts, with one account for each person who can receive e-mail on
the server. My account name might be mbrain, John Smith's might be jsmith, and so on.
2. It would have a text file for each account in the list. So, the server would have a text file in its
directory named MBRAIN.TXT, another named JSMITH.TXT, and so on.

3. If someone wanted to send me a message, the person would compose a text messages ("Marshall,
Can we have lunch Monday? John") in an e-mail client, and indicate that the message should go to
mbrain. When the person presses the Send button, the e-mail client would connect to the e-mail
server and pass to the server the name of the recipient (mbrain), the name of the sender (jsmith) and
the body of the message.

4. The server would format those pieces of information and append them to the bottom of the
MBRAIN.TXT file. The entry in the file might look like this:

From: jsmith To: mbrain Marshall, Can we have lunch Monday? John

.
Real Time Email Server
For the vast majority of people right now, the real e-mail system consists of two different servers
running on a server machine. One is called the SMTP server, where SMTP stands for Simple
Mail Transfer Protocol. The SMTP server handles outgoing mail. The other is either a POP3
server or an IMAP server, both of which handle incoming mail. POP stands for Post Office
Protocol, and IMAP stands for Internet Mail Access Protocol.
The SMTP server listens on well-known port number 25, POP3 listens on port 110 and IMAP uses
port 143

1.3 Introduction to Project “Java Mail Server”

Introduction
This project “Java Mail server “ is about a client/server multi-threaded socket class, which helps
The thread is optional since the developer is still responsible to decide if needs it. There are other
Socket classes here and other places over the Internet but none of them can provide feedback (event
detection) to your application like this one does. It provides you with the following events
detection: connection established, connection dropped, connection failed and data reception
(including 0 byte packet).

.
Description

Java Mail Server provides threading support automatically for you, which handles the socket
connection and disconnection to a peer. It also features some options not yet found in any socket
classes that I have seen so far. It supports both client and server sockets. A server socket can be
referred as to a socket that can accept many connections. And a client socket is a socket that is
connected to server socket. You may still use this class to communicate between two applications
without establishing a connection. In the latter case, you will want to create two UDP server sockets
(one for each application). This class also helps reduce coding need to create chat-like applications
and IPC (Inter-Process Communication) between two or more applications (processes). Reliable
communication between two peers is also supported with TCP/IP with error handling. You may
want to use the smart addressing operation to control the destination of the data being transmitted
(UDP only). TCP operation of this class deals only with communication between two peers.

Analysis of Network Client Server

TCP/IP stack

The TCP/IP stack is shorter than the OSI one:

.
TCP is a connection-oriented protocol; UDP (User Datagram Protocol) is a connectionless
protocol.

IP datagram’s
The IP layer provides a connectionless and unreliable delivery system. It considers each datagram
independently of the others. Any association between datagram must be supplied by the higher
layers. The IP layer supplies a checksum that includes its own header. The header includes the
source and destination addresses. The IP layer handles routing through an Internet. It is also
responsible for breaking up large datagram into smaller ones for transmission and reassembling
them at the other end.

UDP
UDP is also connectionless and unreliable. What it adds to IP is a checksum for the contents of the
datagram and port numbers. These are used to give a client/server model - see later.

.
TCP
TCP supplies logic to give a reliable connection-oriented protocol above IP. It provides a virtual
circuit that two processes can use to communicate.

Internet addresses
In order to use a service, you must be able to find it. The Internet uses an address scheme for
machines so that they can be located. The address is a 32 bit integer which gives the IP address.
This encodes a network ID and more addressing. The network ID falls into various classes
according to the size of the network address.

Network address
Class A uses 8 bits for the network address with 24 bits left over for other addressing. Class B uses
16 bit network addressing. Class C uses 24 bit network addressing and class D uses all 32.

Subnet address
Internally, the UNIX network is divided into sub networks. Building 11 is currently on one sub
network and uses 10-bit addressing, allowing 1024 different hosts.

Host address
8 bits are finally used for host addresses within our subnet. This places a limit of 256 machines that
can be on the subnet.
Total address

The 32 bit address is usually written as 4 integers separated by dots.

.
Port addresses
A service exists on a host, and is identified by its port. This is a 16 bit number. To send a message
to a server, you send it to the port for that service of the host that it is running on. This is not location
transparency! Certain of these ports are "well known".

Sockets
A socket is a data structure maintained by the system to handle network connections. A socket is
created using the call socket. It returns an integer that is like a file descriptor. In fact, under
Windows, this handle can be used with ReadFile and WriteFile functions.

2. System Requirement Analysis

2.1 Introduction: The project “Java Mail server” is divided in to three modules i.e Server
module, Client Module, Email Inbox module. Server accepts the connection from different clients
through server socket class and all the details regarding client connection establishment , sending,
receiving and termination is stored in the server . Clients can connect to the server when server is
active, Each client can send and receive mails, attachment to other clients.

Clients user name and passwords are stored in data files, Email inbox module handles all the
functions related mails like mail forwarding, view attachment, save attachment or mail etc. This
Project also provides threading support automatically, which handles the socket connection and
disconnection to a peer. It supports both client and server sockets. A server socket can be referred
as to a socket that can accept many connections. And a client socket is a socket that is connected to
server socket.

2.2 Software Requirement:

Language: Java
Platform: Netbeans IDE

Tool: Jdk 1.7

Client: Own Client designed Using Java Socket.

.
Server: Server designed Using Java Server Socket

Hardware Requirement:
RAM: 128MB (Minimum).

Processor: Pentium 2 and above.

Processor Speed: Above 500 MHz.

2.3 Functional Requirement

 Transmitting Message and Files between Client and Server.

 The data will be valid until the Server is Valid.

 Everything defined as Object oriented.

 Server has been developed using Server Socket programming in Java.

 Client has been developed using Socket Programming.

 Transmitting data between Client and Server has been developed IP address.

 We are running it as Server Client in PC itself.

 We can convert it to internet server and client processing by implementing POP3 protocol
and SMTP server.

 We have Used Data file to store username, password and mails.

 Usage of Sql Server will not be needed for sending Messages and attachments.

.
2.4 Non- Functional Requirement:
All IT systems at some point in their lifecycle need to consider non-functional requirements and
their testing. For some projects these requirements warrant extensive work and for other project
domains a quick check through may be sufficient. As a minimum, the following list can be a helpful
reminder to ensure you have covered the basics. Based on your own project characteristics, I would
recommend the topics are converted into SMART (Specific, Measurable, Attainable, Realisable,
Timeboxed / Traceable) requirements with the detail and rigour appropriate to your project.

The list is also available at the bottom of the article as a one-page PDF document. While it is easy
to make the list longer by adding more items, I would really like to hear how to make the list better
while keeping it on one page (and readable) to share with other visitors here.

Security
• Login requirements - access levels, CRUD levels
• Password requirements - length, special characters, expiry, recycling policies •
Inactivity timeouts – durations, actions

Audit
• Audited elements – what business elements will be audited?
• Audited fields – which data fields will be audited?
• Audit file characteristics - before image, after image, user and time stamp, etc

Performance
• Response times - application loading, screen open and refresh times, etc
• Processing times – functions, calculations, imports, exports
• Query and Reporting times – initial loads and subsequent loads

Capacity
• Throughput – how many transactions per hour does the system need to be able to handle?
• Storage – how much data does the system need to be able to store?

.
• Year-on-year growth requirements

Availability
• Hours of operation – when is it available? Consider weekends, holidays, maintenance times,
etc

• Locations of operation – where should it be available from, what are the connection
requirements?

Reliability
• Mean Time Between Failures – What is the acceptable threshold for down-time? e.g. one a
year, 4,000 hours

• Mean Time To Recovery – if broken, how much time is available to get the system back up
again?

Integrity
• Fault trapping (I/O) – how to handle electronic interface failures, etc
• Bad data trapping - data imports, flag-and-continue or stop the import policies, etc
• Data integrity – referential integrity in database tables and interfaces
• Image compression and decompression standards

.
3. System Design

DFD: Data Flow Diagram is the graphical description of the system's data and how the processes

transform the data. Data Flow diagram depicts information flow, the information flow and the transforms
that are applied as data move from the input to output. It is the starting point of the design phase that
functionally decomposes the requirement specifications down to the lowest level of details. Thus a DFD
describes what data flows (logical) rather than how they are processed.

Unlike detailed flowchart, Data Flow Diagrams do no supply detailed description of the modules but
graphically describes a system's data and how the data interacts with the system. To construct a Data
Flow Diagram, we use

> Arrows
> Circles
> Open End Box
> Squares
An arrow identifies the dataflow in motion. It is a pipeline through which information is flown like the
rectangle in the flowchart. A circle stands for process that converts data into information. An open-ended
box represents a data store, data at rest or a temporary repository of data. A square defines a source or
destination of system data.

Rules for constructing a Data Flow Diagram


> Arrows should not cross each other.
> Squares, circles and files must bear names.
> Decomposed data flow squares and circles can have same names.
> Choose meaningful names for data flow
> Draw all data flows around the outside of the diagram.

.
DFD 0:

.
Clients(User name, User and
Java Mail Server
Password) Email File

Users
detail

Read mail GUI


user_name, password

Successful Login
Login GUI

username, password Compose Mail

Client/ User

View Attached
File

DFD 1:

Use case Diagram:


A use case diagram at its simplest is a representation of a user's interaction with the system and
depicting the specifications of a use case. A use case diagram can portray the different types of
users of a system and the various ways that they interact with the system. This type of diagram is

.
typically used in conjunction with the textual use case and will often be accompanied by other
types of diagrams as well.

Sequence Diagram

Read Mails

include

Compose Mail
include Login

Client
View Attachment

Manage mails

A sequence diagram is a kind of interaction diagram that shows how processes operate with one
another and in what order. It is a construct of a Message Sequence Chart. A sequence diagram
shows object interactions arranged in time sequence. It depicts the objects and classes involved in
the scenario and the sequence of messages exchanged between the objects needed to carry out the

.
functionality of the scenario. Sequence diagrams are typically associated with use case realizations
in the Logical View of the system under development. Sequence diagrams are sometimes called
event diagrams, event scenarios

A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that
live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order
in which they occur. This allows the specification of simple runtime scenarios in a graphical
manner.

4.System Development

Development includes all those activities that take place to convert from the old system to the new.

The old system consists of manual operations, which is operated in a very different manner from the

proposed new system. A proper implementation is essential to provide a reliable system to meet the

Client1 Server Client2


connect to server(user, password)

Login Accepted

Choose create mail

Type message

Add receiver

deliever mail to receiver

Acknowledge (mail sent)

.
requirements of the organizations. An improper installation may affect the success of the

computerized system.

Module Classification:
E mail Client : Email Client class is used by clients to connect to the server, we have to provide
the server address which can handle all the clients, here we use 127.0.0.1 as the server address.

When client log in to the system , he has two choices depending on whether he is a new user or
existing user, client has to provide his user name and password to connect to the server, if login
accepted then server displays the status of the client if client is the existing user

Client can also create his account to login for next time and use the services.

Email Client is the class used to handle different clients. The basic functions performed in this class
are:

1. Set up the connection information to connect to the server for e.g. port no. used to make
request, ip address of the server etc.

2. Get different clients or users information from the server


3. Launch the login GUI, Login GUI used by different clients to login to the system.
4. Sends any mail in clients inbox back to server
5. Delete, add mail function can also be performed by the client

Methods in Email Client Class:

1. Getusernamesfrom_server(): this function returns all the user names in the server,
2. Shutdown(): This method is called when client shut down or logout from his account. When
client shutdown or closes his window, all the mails in his inbox will be transferred to the
server again.

3. Backup_mail(): This method is used to create copy of client inbox for undeletion. Create
one vector and transfer all mails from inbox to that vector.

.
4. Restore_mail(): This method is used to restore the mails from backup list to the inbox list.
This method transfer mails from backup vector to the client inbox.

Client Handler Class:

1. This class implements using thread handling concepts


2. Receive user name from client and set thread name to client name
3. Recieve messages from client
4. Send messages to client from server
5. Recieve correct login name from client or new user name

Methods in Client Handler Class:

1. getUserNameFromClient():recieve correct login name from client or new user name


2. recieveMessagesFromClient()
3. sendMessagesToClient()

Create User GUI Class:

This class handles the operation of registering the new user. This class perform various
operations:

1. Enable clients to create a new user account.


2. Check whether user name chosen by client is already registered or not
3. If user name is already registered then display message, this user name already registered
with us.
4. If chosen user name is not yet registered then accept the new user successfully

Methods of Create user GUI class:

1. checkUserExists (String username, String password): check whether this username and
password is already registered or not.

.
2. sendUserNameToServer(String userName, String password): if new user is successfully
registered then send the information of new user to the server.

3. sendUserNameToClient(String userName, String password): if new user is successfully


registered then also send the new user name to the clients.

Login Window GUI: This class used to create the form for accepting user input for user
name and password.

Various operations performed by this class are:

1. validate the user name and password entered by the user.


2. if user name and password is correct then display the message “ login accepted”
3. if user name and password is incorrect then display the message “ Entered user name and
password is incorrect”

4. Send logged in users name to server

Methods in login GUI class:

1. sendUserNameToServer(String userName, String Password): if user is successfully


logged in to the system then send the logged in information to the server.

2. checkUserExists(String userName, String password): this method check whether the given
user name and password registered in to the system or not, this method simply validate the
user.

.
Email Server Class :

Email server class is used to run the server and to accept the connections from different clients,
Email server accepts the connection on port no 1234, Email server class reads the different
clients and display the status of each client.

It also reads mails from the mail data file , when server shut down all the clients connected to it
would also be shutdown. Email server can handle multiple clients at a time

Various functions performed by Email Server class:

1. create vector for storing users and mails.


2. Set up the socket to accept the connection
3. Update server window details when new client is connected.
4. Extract information from files like users and mails detail

Inbox List Class: this client creates inbox for the clients

1. it adds various features to the inbox for e.g. read mail, delete mail, forward mail etc.
2. This class gets the mails from server and display in to the respective client inbox
3. Client can select any mail from number of mails to read, delete, forward etc.

Main Function menu class: This class handles various operations, and called methods of other
classes for operations like send, read according to the client choice
1. Create GUI for sending mails, if client wants to send mail to other client
2. Create GUI for reading mails, if client wants of read mail
3. This class doesn’t perform any own operation but simply called the methods of other classes

Read mail Window GUI: 1. Create GUI for sending emails

2. This class used to read mails


3. When user select any message for read operation from inbox list and click on read button
then this class is being called.

.
4. This class displays the detail of sender, message etc for e.g. sender address, attached file
size, content etc

5. It provides various choices to the clients like view attachment, save attachment, forward
mail, change display font

6. Clients can save attached file, view attached file, forward mail etc.

Method in read mail GUI:

This class has only one method i.e. action performed in which four others functions are

implemented according to the user choice actionPerformed(ActionEvent e):

if(e.getSource() == viewAttachment): if user makes view attachment choice then application that
can open attached file get open.

if(e.getSource() == saveAttachment): if user makes save attachement choice then create new file
ouptut stream and save that file in to the system

if(e.getSource() == forward): if user makes forward choice then send mail window class is being
called for sending mail to another user as shown

SendMailWindowGUI sendMailWinGUI = new SendMailWindowGUI(email);

if(e.getSource() == changeFont): ): if user makes change font choice then fontchange class being
called for implementing font change in the mail
Send mail window GUI: when user choose send option then this class is being called for
sending mails

1. Call email class to define various fields like receiver address, attachments, content etc.

2. Defines GUI in which user can make different choices like send, send attachment,
multiple receptionist.

3. User can write content by different font style

.
Methods:

Actionperformed(Event e):

if(e.getSource() == send): this means user want to send simple text message, check for multiple

receptionist and then call sendmail() method. if(e.getSource() == sendAttachment): this means

user wants to attach file.

Steps:

 Create new file chooser.


 Select type of file chooser
 Get result of file chooser
 If cancel return to send mail window
 Create new file from chooser selection
 Add attachment to email

if(e.getSource() == multipleRecipients)

 Create new recipient list window


 Set multiple recipients to true

2. Sendmail(): this function sends mail to the server,


 set the new output stream .
 Set up mail information email.setSender(EMailClient.getCurrentUserName());
email.setRecipient(recipient); email.setSubject(textSubject.getText());
email.setContent(textMessage.getText());

 send mail to server objectOut.writeObject(email); objectOut.flush();

.
View Graphics Attachments( ) : helps us view graphics attachments attached along to mail.
When client clicks on view attachement, according to the file type application is opened to display
the attached file.

For e.g if attached file is image file, default image viewer opened.

Screen Shots:

You might also like