Using electronic mail protocols

The three TCP/IP protocols used by a mail server are:

Simple Mail Transport Protocol (SMTP)image\emdash.gifused to send email

Post Office Protocol (POP)image\emdash.gifused to retrieve email

Internet Message Access Protocol (IMAP)image\emdash.gifused to retrieve email

image\nicon.gif Notes

SMTP

SMTP permits the transfer of electronic mail (email). SMTP uses TCP port 25, and like other TCP/IP protocols, uses a stream connection to transport data across the network. SMTP is based on a client/server relationship. The client initiates the request by sending the HELO command. The SMTP server responds by sending a greeting to the client. The SMTP client sends the MAIL command, which identifies the specific user. After the SMTP server accepts the MAIL command, the SMTP client uses the RCTP TO command to identify the recipient of the email. An example of the RCTP TO command is: RCTP TO: <frankj@myaddress.com>.

When the SMTP client finishes sending the RCTP TO command, it sends the DATA command that informs the SMTP server that the SMTP client is ready to send data. If the SMTP server accepts the DATA command, the SMTP client sends the data. After all the data is sent, a line of text containing only a period informs the SMTP server that all the data has been sent. The SMTP server sends a reply code informing the SMTP client that the data was received. The SMTP client then sends the QUIT command and the SMTP server terminates the connection.

POP

POP is used to retrieve email messages from a mail server. A POP client connects to the POP server and accesses all email messages stored on the POP server. The POP client uses TCP port 110. When a POP client connects to a POP server, the POP server responds with a single line of code which is "+OK". When the client receives the greeting, the POP client must use the USER command to indicate what mailbox it wants to access. The PASS command is used to ensure that unauthorized users are not allowed access to a mailbox. The PASS command is the user's password.

When a connection is established, the POP client sends the STAT command to the POP server. The STAT command retrieves information about the user's mailbox. For example, the STAT command informs the POP client how many email messages are in the mailbox. The POP server responds to the STAT command by sending a line of code in the following format: "+OK zz xx", where "zz" is the number of messages and "xx" is the bite size of the messages. For example, if there are four messages in the mailbox and the total byte size is 345 bytes, the format will be "+OK 4 345".

The POP client can retrieve an email message by using the RETR command. The RETR command requires one argument, which is the email message to retrieve. The POP client can delete an email message by using the DELE command. Like the RETR command, the DELE command requires one argument, which is the email message to delete. The POP client terminates the connection by using the Quit command.

 

IMAP

IMAP is a TCP/IP protocol used to retrieve email messages from a mail server. An email client can access an IMAP server and retrieve email messages. For example, a user can access email messages stored on an IMAP server from a computer at home, or a workstation at the office, without the need to transfer messages or files back and forth between these computers.

The IMAP protocol includes commands for creating, renaming, and deleting mailboxes, checking for new email messages, permanently removing email messages, and retrieving email messages.

Key goals for IMAP are:

1. Allows for mail clients to access an IMAP server without reliance on other TCP/IP protocols such as FTP.

2. Allows for compatibility with the Internet message standard (MIME).

3. Allows for mail message access and manipulation from more then one computer.

Differences between IMAP and POP

POP supports offline mail processing and IMAP supports online mail processing. Mail processing refers to the way the mail client uses the protocol to interact with the mail server. The offline mail processing model lets the mail client connect to only one computer to retrieve email messages. The offline mail processing model is not efficient for accessing email messages from different computers. A positive attribute of the offline mail processing model is that it minimizes the use of the server's resources. In contrast, IMAP uses the online mail processing model, in which the mail client can access email messages from more than one computer. IMAP permits the mail client to interact with remote mailboxes as if they were local. For example, you can read an email message from one computer and delete an email message from another computer.

The following summarizes the advantages of using POP and IMAP:

Advantages of using POP:

Advantages of using IMAP:

image\nicon.gif Note