0% found this document useful (0 votes)
36 views51 pages

Electronic Mail

The document explains the architecture and functioning of electronic mail (e-mail), detailing components such as user agents (UAs), mail transfer agents (MTAs), and message access agents (MAAs). It outlines the process of sending and receiving emails, including the roles of SMTP for sending and POP3/IMAP for retrieving messages, as well as the phases of email transfer. Additionally, it discusses the advantages and disadvantages of using POP3 and IMAP protocols for email management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views51 pages

Electronic Mail

The document explains the architecture and functioning of electronic mail (e-mail), detailing components such as user agents (UAs), mail transfer agents (MTAs), and message access agents (MAAs). It outlines the process of sending and receiving emails, including the roles of SMTP for sending and POP3/IMAP for retrieving messages, as well as the phases of email transfer. Additionally, it discusses the advantages and disadvantages of using POP3 and IMAP protocols for email management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

ELECTRONIC MAIL

 Electronic mail (or e-mail) allows users to exchange messages. The


nature of this application, however, is different from other applications
discussed so far.
 In an application such as HTTP or FTP, the server program is running all
the time, waiting for a request from a client. When the request arrives,
the server provides the service. There is a request and there is a
response.
Example

 When Alice sends an email to Bob, she may expect a response, but this
is not a mandate.
 Bob may or may not respond. If he does respond, it is another one-way
transaction. Second, it is neither feasible nor logical for Bob to run a
server program and wait until someone sends an email to him.
 Bob may turn off his computer when he is not using it.
 This means that the idea of client/server programming should be
implemented in another way: using some intermediate computers
(servers).
Architecture

 Alice or Bob is directly connected to the corresponding mail server, in which LAN or WAN
connection is not required, but this variation in the scenario does not affect our discussion.
 In the common scenario, the sender and the receiver of the e-mail, Alice and Bob
respectively, are connected via a LAN or a WAN to two mail servers. The administrator has
created one mailbox for each user where the received messages are stored.
 There are two important points we need to emphasize here. First, Bob cannot bypass the
mail server and use the MTA server directly. To use the MTA server directly, Bob would need
to run the MTA server all the time because he does not know when a message will arrive.
 Second, note that Bob needs another pair of client-server programs: message access
programs. This is because an MTA client-server program is a push program: the client
pushes the message to the server. Bob needs a pull program. The client needs to pull the
message from the server. We discuss more about MAAs shortly.
 The electronic mail system needs two UAs, two pairs of MTAs (client and server), and a pair
of MAAs (client and server).
User Agent

 The first component of an electronic mail system is the user agent (UA).
 It provides service to the user to make the process of sending and
receiving a message easier.
 A user agent is a software package (program) that composes, reads,
replies to, and forwards messages . It also handles local mailboxes on
the user computers.
 There are two types of user agents: command-driven and GUI-based.
 A command-driven user agent normally accepts a one-character
command from the keyboard to perform its task. For example, a user can
type The character r, at the command prompt, to reply to the sender of the
message, or type the character R to reply to the sender and all recipients.
Some examples of command driven user agents are mail, pine, and elm.
 Modern user agents are GUI-based.
 They contain graphical user interface (GUI)components that allow the user
to interact with the software by using both the keyboard and the mouse.
They have graphical components such as icons, menu bars, and windows
that make the services easy to access.
 Some examples of GUI-based user agents are Eudora and Outlook.
SENDING MAIL

 Sending Mail
 To send mail, the user, through the UA, creates mail that looks very
similar to postalmail .
 It has an envelope and a message (see Figure 26.13).
 The envelope usually contains the sender address, the receiver
address, and other information.
Receiving Mail

 The user agent is triggered by the user (or a timer).


 If a user has mail, the UA informs the user with a notice.
 If the user is ready to read the mail, a list is displayed in which each line contains
a summary of the information about a particular message in the mail box.
 The summary usually includes the sender mail address, the subject, and the time
the mail was sent or received.
 The user can select any of the messages and display its contents on the screen.
 Addresses: To deliver mail, a mail handling system must use an addressing
system with unique addresses.
 In the Internet, the address consists of two parts: a local part and a domainname ,
separated by an @ sign
 The local part defines the name of a special file, called the user
mailbox, where all the mail received for a user is stored for
retrieval by the message access agent.
 The second part of the address is the domain name.
Mailing List or Group List

 Electronic mail allows one name, an alias, to represent several different


email addresses; this is called a mailing list.
 Every time a message is to be sent, the system
 checks the recipient’s name against the alias database; if there is a
mailing list for the defined alias, separate messages, one for each entry
in the list, must be prepared and handed to the MTA.
 The formal protocol that defines the MTA client and server in the
Internet is called Simple Mail Transfer Protocol (SMTP).
 SMTP is used two times, between the sender and the sender’s mail
server and between the two mail servers.
Commands and Responses

 SMTP uses commands and responses to transfer messages between an


MTA client and an MTA server.
 The command is from an MTA client to an MTA server; the response is
from an MTA server to the MTA client.
 Each command or reply is terminated by a two character (carriage
return and line feed) end-of-line token.
 Commands: Commands are sent from the client to the server
Mail Transfer Phases:

 The process of transferring a mail message occurs in three phases:


 connection establishment
 mail transfer
 connection termination.
 Connection Establishment After a client has made a TCP connection to
the well known port 25, the SMTP server starts the connection phase.
This phase involves the following three steps:
 1. The server sends code 220 (service ready) to tell the client that it is
ready to receive mail. If the server is not ready, it sends code 421
(service not available).
 2. The client sends the HELO message to identify itself, using its
domain name address. This step is necessary to inform the server of
the domain name of the client.
 3. The server responds with code 250 (request command completed) or
some other code depending on the situation.
Message Transfer

 After connection has been established between the SMTP client and
server, a single message between a sender and one or more recipients
can be exchanged.
 This phase involves eight steps.
 Steps 3 and 4 are repeated if there is more than one recipient.
Steps

 1. The client sends the MAIL FROM message to introduce the sender of
the message. It includes the mail address of the sender (mailbox and
the domain name).
 This step is needed to give the server the return mail address for
returning errors and reporting messages.
 2. The server responds with code 250 or some other appropriate code.
 3. The client sends the RCPT TO (recipient) message, which includes the
mail address of the recipient.
 4. The server responds with code 250 or some other appropriate code.
 5. The client sends the DATA message to initialize the message transfer.
 6. The server responds with code 354 (start mail input) or some other
appropriate message.
 7. The client sends the contents of the message in consecutive lines.
Each line is terminated by a two-character end-of-line token (carriage
return and line feed). The message is terminated by a line containing
just one period.
 8. The server responds with code 250 (OK) or some other appropriate
code.
Commands and Responses in Computer Networks

 1. Introduction to Commands and


Responses in Computer Networks
Commands and responses are essential for communication between network
devices, servers, and clients. They help in network configuration,
troubleshooting, and data exchange. Used in protocols like HTTP, FTP, DNS,
SMTP, and Telnet.

 2. Common Network Commands


Network commands are used for diagnosing and managing network connections.
1. Basic Network Commands

 ping <IP/Domain> → Checks connectivity with a remote device.


 tracert <IP/Domain> (Windows) / traceroute <IP/Domain> (Linux) →
Shows the path taken by packets.
 ipconfig (Windows) / ifconfig (Linux) → Displays IP address and network
configurations.
 netstat → Shows active connections and listening ports.
2. HTTP Commands (Client Requests)

 GET → Requests data from a server (e.g., webpage loading).


 POST → Sends data to a server (e.g., form submission).
 PUT → Updates an existing resource.
 DELETE → Removes a resource from the server.
3. FTP Commands (File Transfer
Protocol)

 ftp <server> → Connects to an FTP server.


 ls → Lists files on the server.
 get <filename> → Downloads a file.
 put <filename> → Uploads a file.
 bye → Disconnects from the server.
4. DNS Commands (Domain Name
System)

 nslookup <domain> → Resolves a domain name to an IP address.


 dig <domain> → Provides detailed DNS lookup information (Linux).
5. Email Protocol Commands (SMTP, IMAP, POP3)SMTP (Sending Emails)

 HELO <domain> → Starts communication with the mail server.


 MAIL FROM:<email> → Specifies the sender’s email.
 RCPT TO:<email> → Specifies the recipient.
 DATA → Starts the message body.
 QUIT → Ends the session.
 IMAP/POP3 (Receiving Emails)LIST → Lists available emails.
 RETR <email_ID> → Retrieves an email.DELE <email_ID> → Deletes an
email.
3. Common Network Responses

 Responses indicate whether a request was successful or encountered an error.


 1. HTTP Response Codes
 1xx – Informational
100 Continue → The request is being processed.
 2xx – Success
200 OK → Request successful.
201 Created → New resource was created.
 3xx – Redirection
301 Moved Permanently → The URL has changed.
302 Found → Temporary redirection.
 4xx – Client Errors
400 Bad Request → Incorrect syntax in request.
403 Forbidden → Access denied.
404 Not Found → Resource does not exist.
 5xx – Server Errors
500 Internal Server Error → Generic server error.
503 Service Unavailable → Server is overloaded or down.
2. FTP Response Codes

 200 Command OK → Command executed successfully.


 220 Service Ready → Server is ready for a connection.
 331 User OK, Password Required → Username accepted, needs
password.
 425 Can’t Open Data Connection → Network issues.
 550 File Not Found → Requested file is missing.
3. DNS Response Codes

 NOERROR → Successful domain resolution.


 NXDOMAIN → Domain does not exist.
 SERVFAIL → DNS server failed to process the request.
4. Email Protocol Response Codes

 220 → Service ready.


 250 → Requested action completed.
 451 → Requested action aborted due to server issue.
 550 → Mailbox unavailable.
4. Applications of Commands and
Responses

 Network Troubleshooting: ping, traceroute, netstat.


 Web Development: HTTP status codes help debug API responses.
 System Administration: FTP, DNS, and Email commands help in
managing servers.
 Security: Checking unauthorized access using netstat and firewall rules.
Mail Transfer Phases

 1. Introduction to Mail Transfer Phases


Email communication follows a structured transfer process involving
multiple agents .
The Mail Transfer Phases ensure smooth delivery from the sender to the
receiver .
Involves protocols like SMTP (Simple Mail Transfer Protocol) for sending
and POP3 (Post Office Protocol v3) / IMAP4 (Internet Message Access
Protocol v4) for receiving.
2. Phases of Email Transfer

 Email transfer happens in three key phases:


 1. Submission Phase (Sending Email from Client to Server)
The sender's Mail User Agent (MUA, e.g., Outlook, Gmail) submits an email
using SMTP.
 The Mail Submission Agent (MSA) processes the email and forwards it
to the Mail Transfer Agent (MTA).
2. Transmission Phase (Transporting Email Over the Internet)
* The Mail Transfer Agent (MTA) sends the email to the
recipient’s MTA via SMTP.
* If the recipient's mail server is down, the email is queued for
retry.

3. Delivery & Retrieval Phase (Receiving Email on Client


Device)
* The recipient's MTA delivers the email to the Mail Delivery
Agent (MDA), which stores it in the mailbox.
* The recipient retrieves emails using POP3 or IMAP4 through
an MUA (e.g., Thunderbird, Gmail).
3. Message Access Agent: POP and
IMAP

 Message Access Agents (MAAs) are responsible for retrieving emails from the
mail server to the client.
 Two major protocols: POP3 and IMAP4.
 1. POP (Post Office Protocol)Used for retrieving emails from the server and
storing them locally.
 Emails are usually deleted from the server after downloading.
 Latest version: POP3 (Post Office Protocol version 3).
 2. IMAP (Internet Message Access Protocol)Allows users to access emails directly
on the server without downloading them.
 Synchronizes emails across multiple devices.
 Latest version: IMAP4 (Internet Message Access Protocol version 4).
4. POP3 (Post Office Protocol v3)

 How POP3 Works - User connects to the email server via POP3.
 Emails are downloaded to the local device.
 Emails are deleted from the server (unless manually configured to keep
them).
 User reads emails offline.
 Features of POP3 - Simple and easy to use.
 Works well for single-device email access.
 Emails are stored locally, reducing server storage usage.
 Advantages of POP3
 ✔️Faster access to emails after download.
 ✔️Saves server storage.
Advantages and disadvantages of
POP3

 Advantages of POP3
 ✔️Faster access to emails after download.
 ✔️Saves server storage.
 ✔️Works offline
 Disadvantages of POP3
 ❌ Emails are not synchronized across devices.
 ❌ Risk of data loss if the local device crashes.
 ❌ No server-side organization (e.g., folders, labels).
5. IMAP4 (Internet Message Access
Protocol v4)

 How IMAP4 Works - User connects to the email server via IMAP4.
 Emails remain on the server, and only previews are downloaded.
 User can read, organize, and delete emails directly on the server.
 Changes sync across all devices.
 Features of IMAP4 - Emails stay on the server unless deleted.
 Multiple devices can access the same mailbox.
 Allows folder organization on the server.
Advantages and disadvantages of IMAP4

 Advantages of IMAP4
 ✔️Access emails from any device.
 ✔️Emails are backed up on the server.
 ✔️Supports folder organization & searching.
 Disadvantages of IMAP4
 ❌ Requires an internet connection to read emails.
 ❌ Consumes more server storage.
 ❌ Can be slower than POP3, especially with large mailboxes.
6. Typical Applications of POP3 and IMAP4

 ✅ POP3 is used in : Basic email applications where users want offline


access.
 Situations where server storage is limited.
 Personal email accounts that don’t need syncing across devices.
 ✅ IMAP4 is used in : Web-based email services like Gmail, Yahoo Mail,
Outlook.
 Corporate email systems requiring multiple device access.
 Cases where users manage emails on multiple devices (phone, laptop,
tablet)
Message Access Agent: POP and
IMAP

 The first and second stages of mail delivery use SMTP (Simple Mail
Transfer Protocol).
 However, SMTP is not involved in the third stage because SMTP is a push
protocol that sends messages from the client to the server.
 On the other hand, the third stage needs a pull protocol where the client
retrieves messages from the server.
 This process uses a Message Access Agent (MAA).
 Currently, two message access protocols are widely used:
- Post Office Protocol, version 3 (POP3)
- Internet Mail Access Protocol, version 4 (IMAP4)
POP3 (Post Office Protocol, Version 3)

 POP3 is simple but has limited functionality.


 The client POP3 software is installed on the recipient's computer, while
the server POP3 software is installed on the mail server.
 Working of POP3:
1. The client opens a connection to the mail server on TCP port 110 to
download emails.
2. The client sends the username and password for authentication.
3. The client retrieves emails one by one from the server.
4. The emails can be deleted from the server after retrieval, depending on
the mode used.
POP3 Modes:

 Delete Mode:
- Emails are deleted from the server after retrieval.
 Keep Mode:
- Emails remain on the server after retrieval, allowing access from multiple
devices.
MAP4 (Internet Mail Access Protocol,
Version 4)

 IMAP4 is an advanced protocol that offers more functionality than POP3.


IMAP4 allows users to manage emails directly on the mail server.
 Advantages of IMAP4 over POP3:
- Emails remain on the server, allowing access from multiple devices.
- Users can organize emails into different folders.
- Supports email preview before downloading.
- Synchronization ensures updates are reflected on all devices.
IMAP4 Extra Functions

✔ A user can check the email header before downloading.


✔ A user can search for specific content before downloading.
✔ A user can partially download emails (useful for large attachments).
✔ A user can create, delete, or rename mailboxes on the server.
✔ A user can organize emails into folders and subfolders.
Mime protocol

 MIME (Multipurpose Internet Mail Extensions) is an extension of SMTP


that allows emails to support text, images, audio, video, and
attachments.
 It converts non-text data into a text-based format that can be sent via
email.
Works of mime

1.The email client composes a message with attachments (images, audio,


etc.).
2. MIME encodes non-text content into a format suitable for email
transmission.
3. The email is sent using SMTP to the recipient’s mail server.
4. The recipient’s email client decodes the MIME content and displays it
correctly.
Features of MIME

- Supports multimedia content in emails.


- Allows multiple attachments in a single email.
- Uses Base64 encoding for non-text content.
- Enables email formatting (bold, italic, fonts, etc.).
MIME Headers Work in Emails

1. MIME-Version ensures the message is processed as a MIME email.


2. Content-Type tells the email client what kind of content is inside (text,
image, video, etc.).
3. Content-Transfer-Encoding ensures non-text data (like images) is
converted into a format suitable for email transmission.
4. Content-Disposition defines if the file is an attachment or should be
displayed inline.
5. Content-ID is used in HTML emails to reference embedded images.
Web-based Mail

 Web-based mail is an email service that can be accessed through a web


browser instead of an email client.
 Users can send, receive, and manage emails from any device with an
internet connection .
 Examples: Gmail, Yahoo Mail, Outlook.com
Works of web-based

1. User Login → The user logs into their webmail account using a browser.
2. Email Storage → Emails are stored on the mail provider’s remote server.
3. Sending Emails → When a user sends an email, it goes through SMTP
(Simple Mail Transfer Protocol).
4. Receiving Emails → The email is fetched from the server using IMAP or
POP3 protocols.
5. Email Access → Users can read, reply, forward, and organize emails
through the web interface.
Features of Web-Based Mail

✔ No Need for Installation → Works on any device with a browser.


✔ Anywhere Access → Emails can be accessed from any location with the
internet.
✔ Cloud Storage → Emails and attachments are stored online, not on the
local device.
✔ Security Features → Includes spam filters, encryption, and two-factor
authentication.
✔ Integration → Works with calendars, contacts, and cloud storage (e.g.,
Google Drive, OneDrive).
Advantages of Web-Based Mail

✅ Accessible from anywhere


– No need for a specific device or email client.
✅ Automatic updates
– The email provider maintains and updates the service.
✅ Large storage space
– Cloud-based storage for emails and attachments.
✅ Spam and virus protection
– Built-in security features.
Disadvantages of Web-Based Mail

❌ Needs an internet connection


– Cannot access emails offline unless stored.
❌ Security risks
– Web-based services can be targeted by hackers.
❌ Limited control
– Users rely on the email provider for data storage and privacy.

You might also like