Electronic Mail - SMTP
Electronic Mail - SMTP
Electronic Mail - SMTP
20.1 ARCHITECTURE
To explain the architecture of email, we give four scenarios. We begin with the simplest situation and add complexity as we proceed. The fourth scenario is the most common in the exchange of email.
The topics discussed in this section include: First Scenario Second Scenario Third Scenario Fourth Scenario
Figure 20.1
First scenario
Note: When the sender and the receiver of an email are on the same system, we need only two user agents.
Figure 20.2
Second scenario
Note: When the sender and the receiver of an email are on different systems, we need two UAs and a pair of MTAs (client and server).
Figure 20.3
Third scenario
Note: When the sender is connected to the mail server via a LAN or a WAN, we need two UAs and two pairs of MTAs (client and server).
Figure 20.4
Fourth scenario
Figure 20.5
10
Note: When both sender and receiver are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs of MTAs (client and server), and a pair of MAAs (client and server). This is the most common situation today.
TCP/IP Protocol Suite
11
Figure 20.6
User agent
The user agent (UA) provides service to the user to make the process of sending and receiving a message easier.
12
Note: Some examples of command-driven user agents are mail, pine, and elm
13
Note: Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.
14
Composing a message
15
Reading message
Incoming mail box when user invokes Shows a one line summary
16
Replying to message
Reply to original sender or all the receivers Original plus new message
17
Forwarding message
18
Handling mailbox
19
Figure 20.7
20
Receiving mail
User/ timer triggers the UA List of lines having summaru of received message is displayed As per the users selection message is displayed
21
Figure 20.8
Email address
Local port: stored mails r retrieved by the MAA Doamain name: Mail servers or exchangers
22
E- mail
Simple structure NVT 7-bit ASCII format MIME allows non ASCII data
23
24
25
Figure 20.13
SMTP range
26
Figure 20.14
Command and responses are terminated by carriage return and line feed
27
Figure 20.15
Command format
28
29
30
31
Figure 20.16
Connection establishment
32
Figure 20.17
Message transfer
33
Figure 20.18
Connection termination
34
Example 1
Let us see how we can directly use SMTP to send an email and simulate the commands and responses we described in this section. We use TELNET to log into port 25 (the well-known port for SMTP). We then use the commands directly to send an email. In this example, [email protected] is sending an email to himself. The first few lines show TELNET trying to connect to the adelphia mail server.
$ telnet mail.adelphia.net 25
Trying 68.168.78.100... Connected to mail.adelphia.net (68.168.78.100). After connection, we can type the SMTP commands and then receive the responses as shown below. We have shown the commands in black and the responses in color. Note that we have added for clarification some comment lines, designated by the = sign. These lines are not part of the email procedure.
TCP/IP Protocol Suite
35
Example 1 (Continued)
================== Connection Establishment ================ 220 mta13.adelphia.net SMTP server ready Fri, 6 Aug 2004 . . . HELO mail.adelphia.net 250 mta13.adelphia.net ===================== Envelope =================== MAIL FROM: [email protected] 250 Sender <[email protected]> Ok RCPT TO: [email protected] 250 Recipient <[email protected]> Ok =================== Header and Body ================== DATA 354 Ok Send data ending with <CRLF>.<CRLF> From: Forouzan TO: Forouzan This is a test message to show SMTP in action. TCP/IP Protocol Suite .
36
Example 1 (Continued)
============= Connection Termination=============== 250 Message received: [email protected] QUIT 221 mta13.adelphia.net SMTP server closing connection Connection closed by foreign host.
37
38