f mail messages. Commands are sent from the client to the server while responses are sent from the server to the client. Both the commands and the responses carry messages across client and server (see Figure 29.1). A keyword followed by zero or more arguments makes up a command. There are 14 commands defined by SMTP. There are three phases of mail transfer: 1. Connection establishment 2. Message transfer 3. Connection termination The SMTP server starts the connection phase after the client has established a TCP connection to the well-known port 25. Exchange of a single message takes Mail Communication Commands Client Server Responses Figure 29.1 Client-server model of mail transfer. client server server access access server client Figure 29.2 Mail delivery process. place between the sender and one or more recipients after the establishment of a connection between the SMTP client and server. The connection between the SMTP client and server is terminated by the client after the successful transfer of the message between them. The transfer of mails from the sender to the receiver involves the following stages (see Figure 29.2): a. Stage 1: The mail is transferred from the user agent that uses the SMTP client software to the local server that uses the SMTP server software. There would be another remote SMTP server as the connectivity to the remote server may not be available at all times from the SMTP client. The mail is stored in the local server before it is transferred to the remote server. b. Stage 2: The local server now acts as the SMTP client to the remote server that is now the SMTP server. Data needs to be sent from the local server to the remote server that is now the SMTP server. This mail server receives the mail and stores the mail in the user mailbox for later retrieval. C. Stage 3: In this stage the mail access client uses mail access protocols like POP3 (Post Office Protocol, version 3) or IMAP4 (Internet Mail Access Protocol, version 4) to access the mail SO as to obtain the mail. Fundamentals of E