SMTP by stariya

VIEWS: 6 PAGES: 21

									                                         Abstract
                                   (Electronic mail)

       h d                  RFC                      RFC 822
MIME

                                            SMTP               Sender
                                   SMTP Protocol                                TCP IP
     SMTP Receiver


                                         Keyterm
SMTP - Simple Mail Transfer Protocol
                                                 h                 TCP/IP protocol
MIME - Multipurpose Internet Mail Extensions
                                               SMTP


                                       Introduction
                      electronic
                h d                                            d                              -
                           SMTP S d                                                  Server

                              operating system             h
           1.
                    RFC 822 header
                                             user
          2.                                              RFC

SMTP sender                                                     SMTP             TCP
                                                                         SMTP     d
                                                                    SMTP          d
                                          h                achable, out of operation
          TCP                                                        d      ำ requeue




SMTP protocol              SMTP       d            SMTP                  TCP
                                               ,



SMTP            reliable

SMTP receiver
copy                              d
                       Architecture and Services
                                  electronic
                                                            message           transfer    agent

command-based, menu-based             h                                   message transfer agent
                    d                          background

                     (email system)
          1. Composition
          2. Transfer
          3. Reporting                                                ,        ธ

          4. Displaying                                          PostScript

          5. Disposition          ำ                         ,




                   ,    ,

                                                                                          dd
                                          h d              d   h d   -
           d




         Name:Mr.Daniel Dumkopf
         Street:18 Willow Lane
         State:NY
                                                Envelope
         Zip Code:10604
         Priority Urgent
         Encryption:None
         From:United Gizmo
         Address:180 Main St.
         Location:Boston,MA 02120
         Date:Sept 1,1996
         Subject:Invoice 1081
         Dear Mr.Dumkopf,
         Our computer record show that          Message
         you still have not paid the
         above invoice of $0.00. Please
         send us a check for $0.00
         promptly.
               Yours truly
               United Gizmo



                         RFC 822
E-mail
                    1
                                                   ASCII                     ,


            Header                                         ความหมาย
            To:               Email address
            Cc:               Email address
            Bcc:              Email address
            From:
            Sender:                                                      )
            Received:         transfer agent
            Return-Path:
To:       DNS dd

Cc:        dd                                                    Email
                                                                                     C
           Carbon Copy)

Bcc: (Blind carbon copy)                   Cc

From:           Sender:
                                          ฯ                                      From:
           ฯ               Sender:        Sender
      ฯ

Received: transfer agent                                                         agent's
d

Return-Path:

                                                            R    d                       -
            Header                                      ความหมาย
            Date:                             email
            Reply-To:        Email address
            Message-Id:
            In-Reply-To:     Message-Id
            References:      Message-Id
            Keywords:                keywords
            Subject:

Reply-To:
                                                                   ฯ                    Reply-To

        RFC 822                                                                                -
                                                         -F - - h -D             -D   - -h -

                 H d


                              MIME Overview
   MIME                        RFC                                          SMTP       RFC
          Email
   1. SMTP

        UNIX UUencode/UUdecode            ธ
   2.   SMTP              text file                                 -
        SMTP          7-bit ASCII
   3.   SMTP server              ธ
   4.   SMTP gateway                            ASCII      EBCDIC
   5.   SMTP gateway                                                    ธ
   6.           SMTP                RFC
                ,                        CR               )       LF       d)
           
                                   white space
                
                                     tab

           MIME                                                                         RFC    822
                         RFC                  RFC

ราย        ย          MIME
      1.                                      5                                         RFC
      2.                                                                            d
      3.
                                     ธ
       MIME-version                parameter       1.0                                        RFC
        1521     1522
       Content-Type                                                                          agent

       Content-transfer-encoding                                                                 ,

       Content-id                                        MIME
       Content-description



                                                                RFC 822                       MIME



                               MIME Content Types
                                                    7             RFC
                                          h
Content-Type: video/mpeg

               Type            Subtype                                    คา   าย
                               Plain                        ธ
               Text
                               Richtext
                             Gif                       GIF
         Image
                             Jpeg                      JPEG
         Audio               Basic
         Video               Mpeg                         MPEG
                             Octet-stream                                   8-bit
         Application
                             Postscript                               PostScript
                             Rfc822                                 RFC
         Message             Partial
                             External-body
                             Mixed
                             Alternative
         Multipart
                             Parallel
                             Digest            subtype default

Text Type                ธ
    text/plain

    text/richtext
                                                                 -                 -
                     )                         SGML S d d Generalized Markup Language)
                         HTML
       The <bold> time </bold> has come the<italic> walrus </italic> said ...

       The time has come the walrus said ...




Image Type
                                                GIF       JPEG
Audio Type แ Video Type                                               d

     d          Moving Picture Experts Group (MPEG)

Application Type
    application/octet-stream
    application/postscript                P S                              Ad         S
                                                                                                      C
         compiler        d                               P S

Message Type                                             MIME
    message/rfc822                                                       h d
    message/partial subtype

             Id                                                 Id

             Number

             Total                                                                                number




                    1.                                N
                    2.                       header                   C           -T       -E d
                                          - ASCII                     C          -T
                                        id, number = 1                  N

                    3.                                      MIME         C             -T      C      -
                             T   -E d                                     M              -ID
                    4.                                    header Message-ID
                             C   -T              d
                                                                         Content-Transfer-
                  Encoding



             1.             header                                  Content-Type, Content-
                  Transfer-Encoding     M         -ID

             2.                       header
             3.




    หมาย ว แร
From:Bill@host.com
To:joe@otherhost.com                               หมาย ว 2
Subject:Audio mail                             From:Bill@host.com
Message-ID:<id1@host.com>                      To:joe@otherhost.com
MIME-Version:1.0                               Subject:Audio mail
Content-type:message/partial;                  MIME-Version:1.0
id="ABC@host.com";number=1;total=2             Message-ID:<id2@host.com>
Message-ID:<anotherid@foo.com>                 Content-type:message/partial;
MIME=Version:1.0                               id="ABC@host.com";number=2;total=2
Content-type:audio/basic                       ...second half of encoded audio data
Content-transfer-encoding:base64
...first half of encoded audio data
                                  หมายห รวม
                              From:Bill@host.com
                              To:joe@otherhost.com
                              Subject:Audio mail
                              Message-ID:<anotherid@foo.com>
                              MIME-Version:1.0
                              Content-type:audio/basic
                              Content-transfer-encoding:base64
                              ...first half of encoded audio data
                              ...second half of encoded audio data

        message/external-body
                                   C       -T
               FTP                                                              FTP)
                                                                                        d
                                                                                  d                     d
                                       d               ธ                          ASCII
                                                              d              d
               TFPT                                                                    TFPT)
                             FTP                                   d             d
               Anon-FTP               FTP                          d             d
               Local-File
               AFS                             AFS A d           F S        )

               Mail-Server                                                           mail server
                                                mail server

Multipart Type
                                                                        hyphen                      d
part              h h
        multipart/mixed
      From:Nathaniel Borenstein<nsb@bellcore.com>
      To:Ned Freed<ned@innosoft.com>
      Subject:Sample message
      MIME-Version:1.0
      Content-Type:multipart/mixed; boundary="simple boundary"

      This is preamble. It is to be ignored,thoung it is a handy place for mail composers to
      include an explanatory note to non-MIME-conformant readers.
      --simple boundary

      This is implicitly-typed plain ASCII text. It does NOT end with a linebreak.
      --simple boundary
      Content-type:text/plain;charset=us-ascii
      This is explicitly-typed plain ASCII text. It DOES end with a line break.

    --simple boundary--
    This is the epilogue. It is also to be ignored.
 multipart/alternative
                            ASCII h               P S
  PostScript                                           h
                        ธ
    From:Nathaniel Borenstein<nsb@bellcore.com>
    To:Ned Freed<ned@innosoft.com>
    Subject:Formatted text mail
    MIME-Version:1.0
    Content-Type:multipart/alternative; boundary="boundary42"

      --boundary42

      Content-Type:text/plain;charset=us-ascii

      ...plain text version of message
          –boundary42
          Content-Type:text/richtext

          ...RFC 1341 richtext version of same message
          –boundary42--


    multipart/parallel                                                                                2
     channel       d h                  d     h
           h
    multipart/digest
     discussion group I                                                         multipart/digest


                       MIME Transfer Encodings
         MIME                ธ    d                            Content-Transfer-Encoding
                   6                     8bit                          d                   SMTP
         7bit                                encode       ธ                        x-token
                                          d-                encode                          base64
    ธ encode

          7bit                                              ASCII
          8bit                                              non-ASCII
          Binary                             binary
          Quoted-printable                                  ASCII
          base64                                      -      -
          x-token                     user

quoted-printable                               ASCII

           1.           ธ                                                                            "="
                                                          ASCII                     - d            ASCII
                                   "=0C"
2.                      33 ("!")           )                                     61
     ("=")
3.                 white space     9       3                d

4. Line break                          -            - d                        RFC 822
5. Soft line break                                              CRLF>
                                               75
     3D0D0A                                                       - d

            American Standard Code for Information Interchange (ASCII)
                b7 0         0      0       0      1       1      1       1
                b6 0         0      1       1      0       0      1       1
                b5 0         1      0       1      0       1      0       1
     b4   b3 b2 b1
     0     0 0 0 NUL DLE SP                 0      @       P      `       p
     0     0 0 1 SOH DC1 !                  1      A       Q      a       q
     0     0 1 0 STX DC2 "                  2      B       R      b       r
     0     0 1 1 ETX DC3 #                  3      C       S      c       s
     0     1 0 0 EOT DC4 $                  4      D       T      d       t
     0     1 0 1 ENQ NAK %                  5      E       U      e       u
     0     1 1 0 ACK SYN &                  6      F       V      f       v
     0     1 1 1 DEL ETB '                  7      G      W       g       w
     1     0 0 0 BS CAN (                   8      H       X      h       x
     1     0 0 1 HT EM )                    9       I      Y      i       y
     1     0 1 0 LF SUB *                   :       J      Z      j       z
     1     0 1 1 VT ESC +                   ;      K       [      k       {
     1     1 0 0 FF FS              ,       <      L       \      l       |
     1     1 0 1 CR GS              -       =      M       ]     m        }
     1     1 1 0 SO RS              .       >      N       ^      n       ~
     1     1 1 1 SI US              /       ?      O       _      o      DEL
base64                 d -        ธ                                PGP (Pretty Good
Pricacy)    PEM P       Eh      dM )
           1. range                                               ASCII    EBCDIC
           2.                        65                         dd
                                          6-bit
           3.
           4.         hyphen ("-")                   RFC
                                      Radix-64 encoding
                              6-bit Character 6-bit character
                              value encoding value encoding
                                0      A         32     g
                                1      B         33     h
                                2      C         34     i
                                3      D         35     j
                                4      E         36     k
                                5      F         37     l
                                6      G         38     m
                                7      H         39     n
                                8       I        40     o
                                9       J        41     p
                               10      K         42     q
                               11      L         43     r
                               12      M         44     s
                               13      N         45     t
                               14      O         46     u
                               15      P         47     v
                               16      Q         48     w
                               17      R         49     x
                               18      S         50     y
                               19      T         51     z
                               20      U         52     0
                               21      V         53     1
                                22         W         54       2
                                23         X         55       3
                                24         Y         56       4
                                25         Z         57       5
                                26         a         58       6
                                27         b         59       7
                                28         c         60       8
                                29         d         61       9
                                30         e         62       +
                                31         f         63       /
                                                    (pad)     =

                   ธ              input         binary 24-bit                               -
          3                               ASCII       EBCDIC                               E
7-bit      ASCII                                      EBCDIC               8-bit    1100   0101
                                                6 bit            H Q               ASCII
                                 1001000 0110101 0110010 1010001



                                     001000 110101 110010 010001
                       235CA1


                                SMTP Commands
                         SMTP                                                       SMTP   d
        SMTP                           SMTP     d      ำ            SMTP



SMTP commands
                                                             argument


                                                SMTP         d)
  คา                           ร แ คา                                       คา     าย
HELO       HELO<SP><domain><CRLF>
MAIL       MAIL<SP>FROM:<reverse-path><CRLF>
RCPT       RCPT<SP>TO:<forward-path><CRLF>
DATA       DATA<CRLF>
RSET       RSET<CRLF>
NOOP       NOOP<CRLF>                                                  (No Operation)
QUIT       QUIT<CRLF>                                                     TCP
SEND       SEND<SP>FROM:<reverse-path><CRLF>
SOML       SOML<SP>FROM:<reverse-path><CRLF>                                                 mailbox
SAML       SAML<SP>FROM:<reverse-path><CRLF>                                             mailbox
VRFY       VRFY<SP><string><CRLF>                                  user name
EXPN       EXPN<SP><string><CRLF>                                                  mailing list
HELP       HELP[<SP><string>]<CRLF>                             symtem-specific documentation
TURN       TURN<CRLF>                                                          d


    CRLF           C       R          L F d
    SP          Space


SMTP replies                              3

            Positive    Completion   reply
                                                           2)
            Positive Intermediate reply
             (                    3)
            Transient Negative Completion reply

             4)
            Permanent Negative Completion reply

                                               (SMTP replies)
Positive Completion Reply
               System status,or system help reply
211

               Help message
214
                              SMTP command)
               <domain> Service ready
220
               <domain>
               <domain> Service closing transmission channel
221
               <domain>
               Requested mail action okay,completed
250

                User not local;will forward to <forward-path>
251
                user                                  <forward-path>
Positive Intermediate Reply
                Start mail input;end with <CRLF>.<CRLF>
354
                                              <CRLF>.<CRLF>
Transient Negative Completion Reply
                <domain> Service not available,losing transmission
421             <domain>
                                                  )
                Requested mail action not taken: mailbox unavailable
450

               Requested action aborted: local error in processing
451

               Requested action not taken: insufficient system storage
452

Permanent Negative Completion Reply
             Syntax error,command unrecognized
500
             Syntax error                                                )
             Syntax error in parameter or arguments
501
             Syntax error                           argument
             Command not implemented
502

               Bad sequence of commands
503
                 Command parameter not implemented
504
                 parameter
                 Requested action not taken: mailbox unavailable
550

                 User not local;please try <forward-path>
551
                 user                                   <forward-path>
                 Requested mail action aborted: exceeded storage allocation
552
                                                        quota
                 Requested action not taken: mailbox name not allowed
553
                                                                     mailbox
                 Transaction failed
554


                       SMTP                   3                                                        )
                                          d                           )
(connection closing)

Connection Setup
SMTP sender                                        TCP       h
h
          1. sender                               TCP    receiver
          2.                                                                     "220 Service Ready"
          3. sender                                 HELO
          4. receiver                 d           "250 OK"
                                                                           S      N A



Mail Transfer
                                          SMTP      d                     SMTP

            1.            MAIL
            2.            RCPT
           3.         DATA

MAIL command            - h
                                 OK
                                                                  421,500,501

RCRT command

            receiver
                         forward                       d                         (251)
                         forward                      d
                   forward address (551)
                      (mailbox)                                     (550)
                  ธ                                                 (450,451,552,553)
                          (421,500,501,503)

                      RCPT                      d



DATA command                                                                             3
                                                             )
(421,500,501,503)         3 SMTP        d
ASCII                   TCP
           SMTP                          OK
                                   (451,452,552,554)

                                            d               RFC

          Sender:       MAIL FROM:<loy@i.am>
          Receiver:     250 OK

          Sender:       RCRT TO:<billgate@microsoft.com>
          Receiver:     250 OK
          Sender:       RCRT TO:<surasit@microsoft.com>
          Receiver:     550 No such user here

          Sender:       RCRT TO:<steve@microsoft.com>
          Receiver:     250 OK

          Sender:       DATA
          Receiver:     354 Start mail input; end with <CRLF>.<CRLF>
          Sender:       Blah Blah Blash...
          Sender:       ...etc. etc. etc.
          Sender:       <CRLF>.<CRLF>
          Receiver:     250 OK

SMTP sender                                                            3
microsoft.com                               SMTP
(mailbox)
sender                          receiver


Connection Closing
SMTP sender
          1. sender QUIT                                  receiver
          2.             TCP                                               QUIT



                                      Summary
                 SMTP

                  PGP              PEM

								
To top