Page 195 - DCAP207_NETWORKS_DCAP406_COMPUTER_NETWORKS
P. 195

Computer Networks/Networks




                    Notes          12.2.2 Mail Exchange

                                   The SMTP design is based on the model of communication illustrated Figure 12.2. After the
                                   client machine mail request, the sender-SMTP sets a two-way connection with a receiver-SMTP.
                                   The receiver-SMTP may be the destination machine or an intermediate machine (mail gateway).
                                   The sender-SMTP will initiate commands which are replied to by the receiver-SMTP.

                                                           Figure 12.2: SMTP Communication


                                                                 SMTP

                                        User                    Commands/Mail                         User
                                                      Senders
                                                       SMTP
                                                                                   Receiver

                                      File                                           SMTP           File
                                      System                            Replies                     System




                                   1.  The client machine SMTP sets a TCP connection with the destination machine SMTP and
                                       then waits for the server to send a service ready message or a service not available message.
                                   2.  HELO (HELO is an abbreviation for hello) is sent and the receiver machine will identify
                                       itself by sending back its domain name. The client machine SMTP uses this to verify if it
                                       reached the right destination SMTP. If the client machine SMTP supports SMTP Service
                                       Extensions, it substitutes an EHLO command in place of the HELO command. A destination
                                       machine SMTP which does not support service extensions responds with a 500 Syntax
                                       error, command unrecognized message. The client machine SMTP then retries with HELO,
                                       or if it cannot transmit the message without one or more service extensions, it should send
                                       a QUIT message. If a receiver-SMTP supports service extensions, it responds with a multi-
                                       line 250 OK message which includes a list of service extensions which it supports.

                                   3.  The client machine now initiates the start of a mail transaction by sending a MAIL command
                                       to the destination machine. This command has the reverse-path that is used to report
                                       errors. It should be noted that a path is more than just the user mailbox@host domain
                                       name pair. Besides, it has a list of routing hosts.
                                   4.  The next step of the actual mail exchange provides the server SMTP with the destinations
                                       for the message; the message may go to more than one recipient. This is accomplished by
                                       sending one or more RCPT TO:<forward-path> commands. Each of them will receive a
                                       reply 250 OK when the destination is known to the server or a 550. No such user here when
                                       it is not known to the server.

                                   5.  When all RCPT commands are sent, the sender forwards a DATA command to notify the
                                       destination machine that the message contents are following. The server replies with 354
                                       Start mail input, end with <CRLF>.<CRLF>. It should be noted that the ending sequence
                                       that the client machine uses to terminate the message data.
                                   6.  The client machine now sends the data line by line ending with the 5-character sequence
                                       <CRLF>.<CRLF> line upon which the destination machine acknowledges with a 250 OK
                                       or an appropriate error message when anything went wrong.






          188                               LOVELY PROFESSIONAL UNIVERSITY
   190   191   192   193   194   195   196   197   198   199   200