SMTP, POP3, and IMAP protocols

Source: Internet
Author: User
Tags imap mx record

SMTP Protocol Introduction    
1. Introduction
SMTP is called Simple Mail transmission protocol (Simple Mail Transfer Protocal). It aims to provide efficient and reliable mail Transmission for users.
. An important feature of SMTP is its ability to transmit mails through transmission, that is, mails can be transmitted over hosts on different networks.
. In either case, email is transmitted from the client to the server, or from one server to another.
SMTP is a request/response protocol. It listens to port 25 to receive users' mail requests and establishes an SMTP connection with the remote mail server.

2. SMTP Working Mechanism
SMTP usually has two working modes: sending SMTP and receiving SMTP. The specific working method is: send SMTP after receiving the user's mail request,
Determines whether the email is a local email. If the email is directly sent to the user's mailbox, query the MX record of the remote email server from the DNS and create
Establish a two-way transmission channel between the remote and receive SMTP, after which the SMTP command is sent by the send SMTP, received by the receive SMTP, and the response is reversed
Aspect transfer. Once the transfer channel is established, the SMTP sender sends the MAIL command to specify the mail sender. If the SMTP recipient can receive the mail
Return the OK response. The SMTP sender then sends the RCPT command to check whether the email is received. If the SMTP receiver receives the message, an OK response is returned. If
If the email cannot be received, the system rejects the response (but does not stop the entire email operation. When the recipient receives all emails
A special sequence is received. If the recipient successfully processes the email, an OK response is returned.

POP Protocol    
Pop stands for Post Office Protocol, which is the Post Office Protocol for receiving emails. It uses TCP port 110.
The third edition is commonly used, so it is referred to as POP3 for short. POP3 still adopts the Client/Server working mode ,. When the client needs services
The user-Side Software (outlookexpress or Foxmail) will establish a TCP connection with the POP3 server, and then it will go through three working forms of the POP3 protocol.
Status. First, the authentication process is used to confirm the user name and password provided by the client. After the authentication is passed, it is transferred to the processing status. In this status, the user can
Receive your own email or delete the email. After the response is completed, the client issues the quit command, and then enters the update status.
Delete the marked email from the server. So far, the whole Pop process has been completed.
Imap protocol    

IMAP is short for Internet Message Access Protocol. As the name suggests, it mainly provides information retrieval through the Internet.
A protocol. IMAP provides a convenient email download service like pop, allowing users to read offline, but IMAP is far from doing so.
Only. The abstract browsing function provided by IMAP allows you to read the arrival time, topic, sender, size, and other information of all emails.
Determine whether to download or not.

IMAP (Internet Message Access potocol) is a protocol used for mailbox access. The IMAP protocol can be used to manage the mailbox on the server on the client, which is different from pop, emails are retained on the server rather than downloaded locally. IMAP is similar to Webmail in this regard. But IMAP is better than webmail. It is more efficient and secure than webmail, and can be read offline. If you want to try it, use Outlook Express. You only need to configure an account, set my email receiving server to an IMAP server.


IMAP (Internet Message Access Protocol) is another protocol that corresponds to POP3. It is a multi-Mailbox email system developed by Stanford University in 1986. It can obtain information about e-mail from the mail server or receive emails directly, with high performance and scalability. IMAP is adopted by many client email software, such as outlookexpress and netscapemessenger. More and more software are supported on IMAP servers, such as criticalpath, Eudora, Iplanet, and Sendmail.
Readers can't help but ask, POP3 is also an email receiving protocol. It is not very useful now. Why should I use the IMAP protocol?

POP3 protocol Insufficiency
Indeed, pop is the first offline protocol standard for Internet mail. It allows users to download emails from the server to a local host and delete emails stored on the email server, in this way, you do not have to connect to the email server for a long time, which greatly reduces the overall overhead of the server and network.
However, POP3 has its inherent defect: when a user receives an email, all emails are cleared from the server and downloaded to the client. During the entire email receiving process, the user cannot know the specific information of the email. The mail can be viewed and deleted slowly only after the full revenue of the hard disk is received. This makes it almost impossible for users to control the right to receive emails. Once an email address is bombed or a large number of emails exist, you cannot analyze the content of the email and the sender's address to determine whether to download or delete the email, resulting in a waste of system resources. The IMAP protocol not only overcomes POP3 defects, but also provides more powerful functions.

Second, IMAP Analysis

Analysis of IMAP
IMAP provides three operation modes
Online mode: emails are retained on the mail server, which can be managed by the client. Its usage is similar to webmail.
Offline: emails are retained on the mail server, which can be managed by the client. This is the same as the POP protocol.
Separation Method: Part of the mail is on the mail server and part is on the client. This is similar to some mature component package applications (such as Lotus Notes/Domino.
IMAP working principle and features
In the online mode, IMAP allows users to access and manipulate information on the mail server like accessing and manipulating local information. The IMAP software allows you to drag emails between local folders and server folders to store files on the local hard disk on the server or retrieve files from the server, all functions can be implemented only by dragging and dropping the mouse once.
You can create folders of any hierarchy on the mailbox on the server on the client, and flexibly move emails between folders to mark emails that have been read or replied, delete unnecessary files.
The abstract browsing feature provided by IMAP allows you to read the arrival time, topic, sender, size, and other information of all emails. You can also download attachments selectively. For example, if an email contains three attachments and only one of them is required, you can download only one attachment. You can determine whether to download all or only a part of the information after you fully understand it, so that users do not take up valuable space and waste network fees for downloading junk information.
IMAP also provides server-based mail processing and shared mail box functions. Emails (including copies of downloaded emails) are retained on the server before being manually deleted, which facilitates the generation and sharing of mail files. You can view emails on the server on any client. This makes it easy for roaming users.
In addition, IMAP allows users to download information from their servers to their computers like POP3, which means they can still read emails offline.
In the separated state, the mail status on the local system and the mail status on the server may be different from that in the subsequent connection. At this point, the IMAP synchronization mechanism solves this problem. The client software of IMAP mail can record users' local operations. When they connect to the network, they will send these operations to the server, and the server will also tell the client software, events that occur on the server side when the user is offline, such as the arrival of new emails, to ensure synchronization between the server and the client.
In IMAP, shared folders can be defined for other users with special access rights. Pop cannot be used to share mail boxes and shared mail, you can only send emails by CC or manually. Shared mailboxes make it easier for working groups that use Internet mail.
IMAP also provides many special functions, such as creating sub-directories and accessing Usenet through IMAP. In terms of system administrators, IMAP also provides a complete set of available features.
The listening port of IMAP is 143. The internal time and date of the message are provided by the server, instead of the time and date given by the message header in rfc822. It is the real date and time of the last arrival of the message. If the information is shipped by the IMAP Copy command, it should be the internal time and date of the source information; if the information is shipped by the iamp APPEND Command, this should be the time and date specifically described by the APPEND Command.
Many Commands are defined in the IMAP protocol and can be executed through telnet, such as authenticate, list, and close.
Lack of IMAP implementation
In terms of using server disk resources, IMAP is not as good as POP3. Because the server-side mail is downloaded to the client and deleted when Pop is used, no additional space is occupied to store the old mail. The IMAP Server keeps the old mails, takes up extra space, and regularly deletes the old mails.
At the same time, it takes some time for the user to check the information title and decide which attachments to download. Therefore, the link time is longer than that in pop mode.
In terms of applications, the complexity of IMAP poses some difficulties for developers to develop servers and client software. For ISP, using IMAP means spending money to purchase the relevant commercial software and high technical support costs. Therefore, there are not many commercial implementation solutions.
At present, some domestic free email sites provide IMAP4 services, such as in Guangzhou, in Sichuan, and in Beijing. As long as we apply for an account on the corresponding website and set up our client software, we can see the new IMAP features different from those of POP3.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.