Anda di halaman 1dari 17

MIME

! "
Multipurpose Internet Mail
Extension

alfady@scs-net.org

''' !
"# $ %
&
$ .............................................................................................. #

$ ................................................................... SMTP %

' ....................................................................... MIME &

' ............................................................ MIME $

( ......................................................... MIME '

............................................ MIME-Version (required) (% &' $ MIME !" #

....................................................... Content-type (required) (% &' $ ) " #

............................ Content-Transfer-Encoding (required) (% &' $ ) #

............................. Content-ID (required / optional) : (- . ,% &' $ ) *+

............................................Content-Description (optional) (- .$ ) /

* ....................................................................... ) # 0 )

................................................................................................................. 7bit

............................................................... Quoted-printable 2 ' / 1

............................................................................................. Base64 )$ 1 & )

## ...................................................... :MIME + 3 ) " #0 (

................................................................................................... 5 # 4& 1 )

2
.....................................................................Top-level : Image 4& 1 )

................................................................... Top-level : Audio 4& 1 )

...................................................... Top- level : Video 4& 1 )

...........................................................Top – level :application 6 ' 4& 1 )

....................................................... Top – level : Multipart 7 1 3 4& 1 )

................................................................ Top – level : message 4& 1 )

#) .............................. MIME RFC 822 8 3 9 7 0 4& &: 0 *

3
Multipurpose Internet Mail Extension MIME
! " #
& )Multipurpose($ "%& &' "
,& - ! SMTP * & ! +& #
MIME / .0 & & )Text( . %&
RFC 1521/1522 1 & 2' 3 4 # 5 26 6 ,0 7&

SMTP , 6
: 0- ! $ ; +& 9, MIME & 8 5
& = & , SMTP SMTP 0 !<
> 4 2 8 4 5 RFC822 1 & 2' # 5 . %&
/ . ,0, 4 4 8@ A & ,& !< >&B =& ?
RFC 821 1 & 2' # 5 SMTP Defacto & &

0, C& 9RFC 821/822 , 5 ! & ;0 4 !<


>D 6 D 6 C & ,0 E 6 0" . %&
& D 6 & "& ; 3! & &6 * ?6 "
)image files) . &' 0)international character sets(F 8

, > & 9 > 1 ! 6 > & &


RFC X.400 , , ' 8 &; , & 6 # & &
H &< & 9, 0IA5 " * 9&< 6 G . & - 0,0& ? 822
! 0# 6 $ &' & I 7 & B 3 6 >&B =& ?A !
'8

/ . 4 RFC 821/822 , ! & &


' D ,02 X.400 " 8@ D B * 9 %& & 9# & 2 0 . &8
4 SMTP &4 &6 * . & &
& , ? & &4 6 & 9, ,& $ 2 &4 B 3 6

4
> RFC 821/822 %& & ! # E 6MIME $ > C
26 6 ,0, 2 /.0 - & RFC 822 : & 0*

MIME C
RFC 822 > $ >&B 9 6 8* ! - 6 •
& # , >&B 9 & #

"%& # J. # 8 •

Attachment > &' '4 7 " •

MIME > & 4


, % , 5 , D K &< 0 ;6L & I> & & 0 !9
& 0RFC 822 & 6 <; 2 >&B 9# - ! MIME # 5 RFC 822 # 5
& 9M! 4 , &< >& > MIME G . &8 >&B = 6
MIME RFC 822 , 0C & . ' API &# E 6 &

> MIME >&B = 6 ;6L A RFC 822 +C 4 ,


2 &<

MIME–Version :1.0
Content–Type : text/plain ;charset=us-ASCII
Content–transfer–Encoding :7bit

5
4

6
MIME >$ 6
RFC >&B 9 6 8 >&B I #&5 MIME ,0& ! &
NF 6 #5 F 6 C 6NF 6 O 6N &6 .= 6 822
* 6 Q 5& ? P &8 4 & F 6 * C &< 0 F 6 D.
F6

MIME-Version (required) )G " ( MIME . 9O 6

# MIME &< > , & >R .


RFC MIME , %& , C & Mail Transfer Agent (MTA)
822

& 3! & *6 .= MIME &6 . = ,9

&1
MIME-Version: 1.0

Content-type (required) )G " ( F 6 O 6


&" O 6 -! " ' & O MIME D
MIME " > O Q 5& ? )media types and subtypes( & >
# ,0# 8 5, > O S / ! ,0* 9 ;6L ? 5
,0G LANA > . &8 . &8 # #& 4 & &< >&B 9
"X-" G 7

&1
Content-type: text/plain; charset="us-ASCII"
or -
Content-type: X-MyNewType
Content-Transfer-Encoding (required) )G " ( F 6 C 6

,0 G )US-ASCII( , 1 0C 1 D 60 * 6 %& ,9
C D & 40$ ? MTA &< 6 #

7
"7bit", "quoted-printable", "base64", "8bit", and "binary"
& 4 / ! ,0 * 9 ;6L ? & > . ' & &<45& D
& 40 , ,0 G & !& & &< >&B 9 # ,0 # 8 5, > C
"X-" G 7 LANA > . &8 C

&1
Content-transfer-encoding: base64

Content-ID (required / optional) : )- & 8 TG " ( F 6 #5 6


&8 %& # F 6 O 0 , & B 6 ! ,
& # 5 6 2 &4 6 ! ?& & 8 , A! H message/external body
#8 ,0 , )unique( 6 , ,0 G 2 0 - 0)Message-ID(
)MIME entities( MIME && D

Content-Description (optional) )- & 8 ( F 6 D. 6


!9 &< > ! & # & 6 D. & &8 = 6 ! #8
, &' . ,B ' , ,0 , 2 0& $ . D - 0, B & & &
&< ' $ .

&1
Content-Description: "This is an image file"

F 6 C & 40
Content-transfer-encoding schemes :
& &" , ,0 G " SMTP ,9 & & & ! &
'4 ,0 - B , , A !7 6 & ? )US-ASCII( 0 G 1
,0 E 6 C & 40 F 6 C 6 6 ? &< , E 6 &"
& &4 6 D #8 . & &6 C A ' ,0, &

8
7bit
DK & & = )default(- & 4 !
)7-bit US-ASCII characters. ( ! 0D &6 ,

Quoted-printable N " D 6
" >A& US-ASCII " , & > D &6 #; , &
! MTA ,B & & 9& !% " !< D &6
&< 6 # & I> 0" > 1 F 8 D &6 & 0RFC 821/822 "
)equal sign($ & $ &4I U & & 4 $ '4

&1

P $ & $ & 49 ' 4 ,0V A " A = B" 1 + 4 & = &6 !9


A ! 7 > 0x3d. 4 &0 $ & 4 ,9? )String(
&& & = ,

A =3D B

Base64 :&

US-( 0 D &6 O * 9 &" > C 4 ! #8


& , && 6 # E 6 " 6 C 8 ,9) ASCII characters
converting three ( &< #5 * 9
? , 'W &" , # !9& 0)data bytes as four six-bit values
& / . * 6 &< &< &< D&B - 0)"="($ & C )padded( ," 2 I>
; Base64 : <' / . G & ,
G 1 D 6 , " 8 4 :& !F 6 C " #8

Base64 D 6 C 4 ,

9
&1

& %&1 & * - 6 -! %&1 D & ,


101000101010001010101010
&& , & * 92 # >
000000 101010 100010 101010 101000

& & )ASCII( 0 & * 92 6 # D && !


YsSqA
& X &5 4 6. 0!

10
&1

&& ) ( & &< FRED ,


1000100 1000101 1010010 1000110
&& / . & &<
100011 010100 101000 101100 010000
&& C &
jUosQ

:MIME 5, > F 6 O 0
Content-types defined by MIME
The top-level media ( " * F O 0 , '. 4 ! " #1 <=> *
D )subtypes( ' O &" & O R . E 6 ) types
" &< * 8 )media( " O 0 A& ? . . 8 J.
)application( 7 " ?)video( > ? )audio( . ? )image( $ . ? )text(P
)message( & )multipart(+ C & ,& ,&1 ,& &

O & # & MIME # & & &< > " O C


" * F O 0# #& 4 ? MIME # .6 O
top- &< H. , $ 6 O 0J . D ' O *9
level/subtype; parameter
. .8 & !9 &8 0 B )Parameters( 6 , ,0 ,
O 3! ?2 >&B =& ' 2 0 &< ' 7 " * F O
> MIME $ O 6% , & , C * .6 , &>
IANA

Top-level: text 5 # 4& 1 ) # (


(Parameter$
charset D &6

11
D 6 &6 )case-sensitive(: & 6 6

)Default value( B >


US-ASCII
: )Predefined character sets(& > D &6
US-ASCII
ISO-8859-X (Where X is to be replaced with the correct number)

&;6L

& C ,0G > & & & 1 & ,& !9

)Subtypes( ' O
Plain
Unformatted text
Richtext
Simple formatting, such as bold, italic, and
underline (RFC 1341)
Enriched
A clarified, simplified, and refined Richtext (RFC
1896)

Top-level : Image 4& 1 ) % (


(Parameter$

&;6L

& C IANA > $ . ,& ' O

)Subtypes( ' O
JPEG JPEG format using JFIF encoding

12
Top-level : Audio 4& 1 ) & (
)Parameter( 6

&;6L

O M&6 & . &' " 4 '. 50 & ' O


"application/octet-stream" A & ,0G 8@ >

)Subtypes( ' O
basic Single channel audio encoded using 8bit ISDN
mu-law [PCM] at a sample rate of 8000 Hz.

Top- level : Video >* F


)Parameter( 6

&;6L

)Subtypes( ' O
MPEG ISO 11172 format.

Top – level :application 7 " * F


(Parameter$

&;6L

A! & &' . 60 6 " && O ! 4


6 7 " G U& &"

13
)Subtypes( ' O
octet-stream
Arbitrary binary data
postscript
A postscript program

Top – level : Multipart + C * F


,B 6 ,@ > &> $ * - 6 & C #& O
, " 6 0 &> , 6 D -! )Boundary ( 6 6
& H . &<
-- boundary name
)boundary( 6 )Parameter( 6 , 0C * - 6 & 4 ,
& # + C 0C 6

14
&;6L

& ' < D 6 *9 , &6 )boundary( 6 , ,0G

)Subtypes( ' O
mixed
Sequentially processed multiple body parts. Used when order is important
parallel
Multiple body parts processed in parallel
digest
Similar to mixed subtype, but the default content-type is rfc822. This
subtype encapsulates entire email messages so they are displayed
sequentially with both headers and data. Order is important.
alternative
Used when several versions of a mail message are included. Which part is
viewed by the user is dependent upon the capabilities of the UA. Order is
important.

Top – level : message 4& 1 ) ( (


)Parameter( 6

&;6L

G $C %C 8 # ' O , ,0G

)Subtypes( ' O
rfc822
Encapsulates another mail message.
partial
Fragments larger messages, similar to IP fragmentation and reassembly.
&<'. ' &< 0 O # 0, &>

15
MIME RFC 822 & %& , + C 0* 10
(#

16
(%

? @*

17

Anda mungkin juga menyukai