Electronic Mail:
SMTP, POP
IMAP, and MIME
1
Chapter
Outline 1 Architecture
2 User Agent
3 Message Transfer Agent
4 Message Access Agent
5 MIME
6 Web-Based Mail
2
1 ARCHITECTURE
!" #$%&'() *+# ',-+(*#-*.,# "/ #01'(&2 3# 4(5# /".,
6-#)',("67 8# 9#4() 3(*+ *+# 6(1%* 6(*.'*(") '):
':: -"1%&#$(*; '6 3# %,"-##:7 !+# /".,*+ 6-#)',("
(6 *+# 1"6* -"11") () *+# #$-+')4# "/ #01'(&7
ü First Scenario
ü Second Scenario
ü Third Scenario
ü Fourth Scenario
3
Figure 1 First scenario
2
1
4
Figure 2 Second scenario
5
1
2 3 4
When the sender and the receiver of an
e-mail are on the same mail server,
we need only two user agents.
5
Figure 3 Third scenario
3
7
5
4 6
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).
6
Figure 4 Fourth scenario
1 9
2
8
5
4 6
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.
7
Figure 5 Push versus pull
8
2 USER AGENT
!+# /(,6* -"1%")#)* "/ ') #&#-*,")(- 1'(& 6;6*#1 (6
*+# .6#, '4#)* <=>?7 @* %,"5(:#6 6#,5(-# *" *+# .6#,
*" 1'A# *+# %,"-#66 "/ 6#):()4 '): ,#-#(5()4 '
1#66'4# #'6(#,7
Some examples of command-driven
user agents are mail, pine, and elm.
Some examples of GUI-based user agents
are Eudora, Outlook, And Netscape.
9
Figure 6 Format of an email
10
3 MESSAGE TRANSFER AGENT
!+# '-*.'& 1'(& *,')6/#, (6 :")# *+,".4+ 1#66'4#
*,')6/#, '4#)*6 <B!>6?7 !" 6#): 1'(&2 ' 6;6*#1 1.6*
+'5# *+# -&(#)* B!>2 '): *" ,#-#(5# 1'(&2 ' 6;6*#1
1.6* +'5# ' 6#,5#, B!>7 !+# /",1'& %,"*"-"& *+'*
:#/()#6 *+# B!> -&(#)* '): 6#,5#, () *+# @)*#,)#* (6
-'&&#: C(1%&# B'(& !,')6/#, D,"*"-"& <CB!D?7 >6 3#
6'(: 9#/",#2 *3" %'(,6 "/ B!> -&(#)*06#,5#, %,"4,'16
',# .6#: () *+# 1"6* -"11") 6(*.'*(") </".,*+
6-#)',("?7 E(4.,# F 6+"36 *+# ,')4# "/ *+# CB!D
%,"*"-"& () *+(6 6-#)',("7
11
Figure 8 SMTP range
12
Figure 9 Commands and responses
13
14
15
Figure 10 Connection establishment
220 service ready 1
2 HELO: [Link]
250 OK 3
16
Figure 12 Connection termination
1 QUIT
221 service closed 2
18
4 MESSAGE ACCESS AGENT
!+# /(,6* '): *+# 6#-"): 6*'4#6 "/ 1'(& :#&(5#,; .6#
CB!D7 G"3#5#,2 CB!D (6 )"* ()5"&5#: () *+# *+(,:
6*'4# 9#-'.6# CB!D (6 ' %.6+ %,"*"-"&H (* %.6+#6
*+# 1#66'4# /,"1 *+# -&(#)* *" *+# 6#,5#,7 @) "*+#,
3",:62 *+# :(,#-*(") "/ *+# 9.&A :'*' <1#66'4#6? (6
/,"1 *+# -&(#)* *" *+# 6#,5#,7 I) *+# "*+#, +'):2 *+#
*+(,: 6*'4# )##:6 ' %.&& %,"*"-"&H *+# -&(#)* 1.6* %.&&
1#66'4#6 /,"1 *+# 6#,5#,7 !+# :(,#-*(") "/ *+# 9.&A
:'*' ',# /,"1 *+# 6#,5#, *" *+# -&(#)*7 !+# *+(,: 6*'4#
.6#6 ' 1#66'4# '--#66 '4#)*7
19
Figure 13 Pop3 and IMAP4
20
Figure 14 Pop3
21
5 MIME
J&#-*,")(- 1'(& +'6 ' 6(1%&# 6*,.-*.,#7 @*6 6(1%&(-(*;2
+"3#5#,2 -"1#6 3(*+ ' %,(-#7 @* -') 6#): 1#66'4#6
")&; () KL!<K#*3",A L(,*.'& !#,1()'&? M09(* >CN@@
/",1'*7 @) "*+#, 3",:62 (* +'6 6"1# &(1(*'*(")67
B.&*(%.,%"6# @)*#,)#* B'(& J$*#)6(")6 <B@BJ? (6 '
6.%%#)*',; %,"*"-"& *+'* '&&"36 )")0>CN@@ :'*' *"
9# 6#)* *+,".4+ #01'(&7 B@BJ *,')6/",16 )")0>CN@@
:'*' '* *+# 6#):#, 6(*# *" KL! >CN@@ :'*' '): :#&(5#,6
(* *" *+# -&(#)* B!> *" 9# 6#)* *+,".4+ *+# @)*#,)#*7 !+#
1#66'4# '* *+# ,#-#(5()4 6(*# (6 *,')6/",1#: 9'-A *"
*+# ",(4()'& :'*'7
22
Figure 15 MIME
23
Figure 16 MIME header
Ø Mime Version: defines the version of MIME
ØContent-Type: defines the type of data used in the body of message. Type and
subtypes are separated by slash. MIME allows seven different types of data which
are: Text, multipart, message, Image, Video, Audio, Application (post-script,
stream)
ØContent-transfer-encoding: it defines methods used to the message into 0s and
1s for transport. The types are : 7-bit NVT ASCII, 8-bit Non ASCII, Binary Non-
ASCII, Base-64 6-bit blocks of data encoded into 8-bit ASCII and Quoted-Printable
Non-ASCII
ØContent Description: whether the body is image, audio or video. 24
25
26
Figure 17 Base64
27
28
Figure 19 Web-based e-mail, case 1
J01'(& (6 6.-+ ' -"11") '%%&(-'*(") *+'* 6"1#
3#96(*#6 *":'; %,"5(:# *+(6 6#,5(-# *" ');")# 3+"
'--#66#6 *+# 6(*#7
1
HTTP
transactions
3
2 4
29
Figure 20 Web-based e-mail, case 2
HTTP HTTP
transactions transactions
1 2 3
30