Explain in detail how electronic mail applications work in a network. Describe SMTP, POP3, and IMAP protocols.

 

Topics & Subtopics – Electronic Mail, SMTP, POP3, IMAP


1. Electronic Mail Application

1.1 Components of E-mail

  • User Agent (UA)

  • Message Transfer Agent (MTA)

  • Message Access Agent (MAA)

  • Mailbox

  • Message Queue

1.2 E-mail System Architecture

  • Sender UA

  • Sender MTA (SMTP Client)

  • Receiver MTA (SMTP Server)

  • Receiver MAA (POP3/IMAP)

  • Receiver UA

1.3 E-mail Delivery Steps

  • Message composition

  • Queueing

  • SMTP transfer

  • Mailbox storage

  • POP3/IMAP access

1.4 E-mail Address Format

  • Local part

  • Domain part


2. SMTP (Simple Mail Transfer Protocol)

2.1 SMTP Characteristics

  • Application layer protocol

  • Client–server model

  • Runs on TCP port 25

2.2 SMTP Commands

  • HELO

  • MAIL FROM:

  • RCPT TO:

  • DATA

  • QUIT

  • VRFY

  • RSET

2.3 SMTP Replies

  • 2xx (Success)

  • 3xx (More information)

  • 4xx/5xx (Failure)

2.4 SMTP Components

  • SMTP Client

  • SMTP Server

  • SMTP Queues

  • Relays

2.5 SMTP Phases

  • Connection establishment

  • Mail transfer

  • Connection termination


3. POP3 (Post Office Protocol Version 3)

3.1 POP3 Characteristics

  • Application layer protocol

  • Runs on TCP port 110

  • Offline mode

3.2 POP3 Modes

  • Delete mode

  • Keep mode

3.3 POP3 Commands

  • USER

  • PASS

  • STAT

  • LIST

  • RETR

  • DELE

  • QUIT

3.4 POP3 States

  • Authorization

  • Transaction

  • Update


4. IMAP (Internet Message Access Protocol)

4.1 IMAP Characteristics

  • Application layer protocol

  • Runs on TCP port 143

  • Supports multi-device access

  • Supports flags (SEEN, DELETED, etc.)

4.2 IMAP Modes

  • Offline

  • Online

  • Disconnected

4.3 IMAP Commands

  • LOGIN

  • AUTHENTICATE

  • SELECT

  • EXAMINE

  • FETCH

  • CLOSE

  • LOGOUT

4.4 IMAP Server Responses

  • OK

  • NO

  • BAD

4.5 IMAP4 Extra Features

  • Header checking

  • Server searching

  • Partial download

  • Mailbox creation/deletion

  • Folder hierarchy


1. Formal Definition of Electronic Mail (E-mail)

(From cn1.pdf)

Electronic mail (E-mail) is an asynchronous communication medium that allows users to send a single message containing text, audio, video, or graphics to one or more recipients through a computer network. It is supported by components such as the User Agent (UA), Message Transfer Agent (MTA) using SMTP, and Message Access Agents (MAA) such as POP3 and IMAP.


2. Formal Definition of SMTP (Simple Mail Transfer Protocol)

(From cn1.pdf & CS3591 Notes)

Simple Mail Transfer Protocol (SMTP) is a standard application layer protocol in the TCP/IP suite that defines the mechanism for transferring electronic mail between Message Transfer Agents (MTAs) over a TCP connection on port 25. It uses a client–server architecture and exchanges ASCII-based commands and responses to reliably deliver email messages across the Internet.


3. Formal Definition of POP3 (Post Office Protocol Version 3)

(From EduEngg CN Notes & CS3591 Notes)

Post Office Protocol Version 3 (POP3) is an application-layer Internet standard protocol used by local e-mail clients to retrieve e-mail messages from a remote mail server over a TCP/IP connection on port 110. POP3 supports offline email access by downloading messages to the client machine and optionally deleting them from the server.


4. Formal Definition of IMAP (Internet Message Access Protocol)

(From cn1.pdf & CS3591 Notes)

Internet Message Access Protocol (IMAP) is an application-layer client/server protocol that allows an email client to access, manage, and manipulate electronic mail messages stored on a remote mail server over a TCP connection on port 143. IMAP supports multiple modes of email access, remote folder management, message status tracking, and multi-device synchronization.


1. Electronic Mail in a Network – Detailed Working

(From cn1.pdf & CS3591 Notes)

Electronic mail (E-mail) is an asynchronous, fast, inexpensive, and widely used application of computer networks.
It enables users to send text, audio, video, images, and other content to one or more recipients.


1.1 Major Components of E-mail System

a) User Agent (UA)

  • Front-end software that allows users to compose, send, receive, reply, forward, and store messages.

  • Provides mailbox management, message creation, and message reading services.

  • Supports both command-driven and GUI-based interfaces.

  • Examples: mail, pine, elm, Outlook, Eudora.


b) Message Transfer Agent (MTA)

  • Responsible for transferring emails from sender’s mail server to receiver’s mail server over the Internet.

  • Operates based on SMTP.

  • Handles queuing, delivery attempts, relaying, and message forwarding.


c) Message Access Agent (MAA)

  • Used by recipients to retrieve messages from mail servers.

  • Main protocols: POP3, IMAP.

  • Provides authentication, fetching, and mailbox operations.


1.2 Complete Flow of E-mail Delivery (Step-by-Step)

(Expanded using cn1.pdf & CS3591 Notes)

  1. User Agent (UA) prepares message and sends it to local mail server.

  2. Message is placed in the outgoing message queue.

  3. SMTP client (MTA) establishes TCP connection with receiver’s SMTP server.

  4. SMTP transfers message using structured commands and responses.

  5. Receiver’s mail server stores message in recipient’s mailbox.

  6. The receiver connects using POP3 or IMAP to access the mailbox.

  7. Receiver’s UA presents message to the user.

This completes the email cycle from composition → transfer → storage → retrieval.


2. Simple Mail Transfer Protocol (SMTP)

(Extensively expanded)
(Primary source: cn1.pdf & CS3591 notes)

SMTP is the standard protocol for mail transfer between MTAs.
It follows the client–server architecture.


2.1 Characteristics of SMTP

  • Operates in the Application Layer of TCP/IP suite.

  • Uses TCP port 25 for reliable delivery.

  • Push protocol – always pushes messages from sender to receiver.

  • Supports multiple relays using intermediate SMTP servers.

  • Works only with ASCII-based message body unless extended using MIME.


2.2 SMTP Components

  • SMTP Client – initiates the connection.

  • SMTP Server – waits for incoming requests.

  • Queues – store undelivered messages temporarily.

  • Relays – forward messages via multiple servers.


2.3 SMTP Commands & Responses

(From cn1.pdf)

Main Commands

  • HELO – Identify sending host.

  • MAIL FROM: – Start new mail transaction.

  • RCPT TO: – Specify receiver address.

  • DATA – Transfer message body (ends with ".").

  • QUIT – Close SMTP session.

Sample Server Responses

  • 250 – Requested action completed.

  • 354 – Start mail input.

  • 221 – Service closing.

  • 550 – Mailbox unavailable.


2.4 Complete SMTP Message Transfer Scenario

(From cn1.pdf)

  1. Client initiates session using HELO.

  2. Sender provides from-address using MAIL FROM.

  3. For each receiver, client sends RCPT TO.

  4. Message content transmitted using DATA.

  5. Transmission ends with ".".

  6. Session ends using QUIT.

This is the core of MTA-to-MTA email transfer.


3. Post Office Protocol Version 3 (POP3)

(Expanded using EduEngg CN Notes & CS3591 Notes)

POP3 is a Message Access Agent protocol used for retrieving e-mail from a remote server.
It supports offline email processing.


3.1 Characteristics of POP3

  • Uses TCP port 110.

  • Very simple and easy to implement.

  • Requires less Internet usage time – ideal for dial-up or limited connectivity.

  • Supports only one mailbox per user.

  • Does not support folders or remote email organization.

  • No search, partial retrieval, or multi-device synchronization.


3.2 POP3 Modes of Operation

a) Delete Mode

  • After downloading, messages are deleted from server.

  • Used on personal computers.

b) Keep Mode

  • Messages remain on server even after reading.

  • Useful when accessing email from multiple locations.


3.3 POP3 Commands

(From EduEngg CN Notes)

CommandPurpose
USERSend username
PASSSend password
STATNo. of messages & size
LISTMessage summary
RETRRetrieve message
DELEDelete message
QUITEnd session

4. Internet Message Access Protocol (IMAP)

(Expanded using cn1.pdf, CS3591 Notes)

IMAP is a highly advanced Mail Access Protocol that supports mailbox manipulation directly on the server.


4.1 Characteristics of IMAP

  • Runs on TCP port 143.

  • Supports multiple simultaneous clients.

  • Maintains message states using flags like SEEN, ANSWERED, DELETED, RECENT.

  • Supports remote folder hierarchy, allowing mailbox organization.

  • Provides server-based searching and partial download.


4.2 IMAP Modes

a) Offline Mode

Downloads mail and deletes it from server (similar to POP3).

b) Online Mode

All operations performed directly on the server.

c) Disconnected Mode

Messages cached locally; synchronized later.


4.3 IMAP Command Types

(From CS3591 Notes)

  • LOGIN, AUTHENTICATE – User login

  • SELECT, EXAMINE – Select mailbox

  • FETCH – Retrieve message

  • CLOSE, LOGOUT – End session

  • Server response codes: OK, NO, BAD


4.4 IMAP4 Additional Features

(From cn1.pdf)

  • View headers before downloading

  • Search emails using keywords

  • Partial message fetching

  • Create/delete/rename mailboxes

  • Create hierarchical folders

  • Efficient for low-bandwidth users