Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does SMTP mean?
What does SMTP mean?
The goal of Simple Mail Transfer Protocol (SMTP) is to transfer mail reliably and efficiently. It is independent of the transmission subsystem and only needs a channel that can guarantee the order of data units. Appendices A, B, C and D describe the use of SMTP under different delivery services. Terms used in this document are also defined in the glossary.

An important feature of SMTP is that it can relay messages in transmission. The transport service provides an interprocess communication environment (IPCE), which can include a network, several networks or a subnet of networks. It is important to understand that the transmission system (or IPCE) is not one-to-one. A process can communicate directly with other processes through the known IPCE. Mail is communication between applications or processes. Mail can be transmitted on the network through processes connected to different IPCE. More specifically, mail can be relayed through hosts on different networks.

It is the main application layer protocol of Internet e-mail system. It uses the reliable data transmission service provided by TCP to transmit mail messages from the sender's mail server to the receiver's mail server. Like most application-layer protocols, SMTP has two aspects: the client executing on the sender's mail server and the server executing on the receiver's mail server. The client and server of SMTP run on each mail server at the same time. When a mail server sends mail to other mail servers, it operates as an SMTP client. When a mail server receives mail messages from other mail servers, it operates as an SMTP server.

There are many similarities between SMTP protocol and the etiquette people use for face-to-face communication. First, the SMTP client running on the sending mail server host starts the establishment of TCP connection with the SMTP server port number 25 running on the receiving mail server host. If the incoming mail server is not working at present, the SMTP client will wait for some time before trying to establish a connection. After the connection is established, SMTP client and server first perform some application layer handshakes. Just as people often introduce themselves before changing hands, SMTP clients and servers also introduce themselves before transmitting information. In this SMTP handshake phase, the SMTP client points out the email addresses of the sender and the receiver to the server respectively. After introducing themselves to each other, customers send emails. SMTP can rely on the reliable data transmission service provided by TCP to deliver messages to the server without error. If the customer has other mail messages to send to the same server, it will repeat the above process on the same TCP connection; Otherwise, it instructs TCP to close the connection. [ 1]

Edit paragraph 2. SMTP model

The design of SMTP is based on the following communication model: for the user's mail request, a two-way transmission channel is established between sending SMTP and receiving SMTP. The receiving SMTP can be the final receiver or the intermediate sender. The SMTP command is sent by the sender SMTP, received by the receiver SMTP, and the reply is transmitted in the opposite direction.

Once the transmission channel is established, the SMTP sender sends a mail command to indicate the mail sender. if

SMTP recipients can receive messages and return an "OK" reply. Then, the SMTP sender issues the RCPT command to confirm whether the mail has been received. If the SMTP receiver receives it, it returns an OK response; If not, a rejection reply will be sent (but the whole mail operation will not be suspended), and both parties will repeat this operation several times. When the receiver receives all the mails, it will receive a special sequence. If the receiver successfully processes the email, it will return an OK reply.

SMTP provides a mechanism for transmitting mail. If the recipient and the sender are connected under the same transmission service, the mail can be directly transmitted from the sender's host to the recipient's host. Or, when they are not under the same transport service, they are transmitted through a relay SMTP server. In order to provide relay function to SMTP server, it must have the final destination host address and mailbox name.

The MAIL command parameter is the reply path, which specifies where the mail comes from; The parameter of the RCPT command is the forwarding path, which specifies the destination of the mail. The forwarding path is the source path, and the reply path is the return path (used to return mail when an error occurs).

When the same email is sent to different recipients, SMTP will encounter the problem of sending copies of the same data to different recipients. Mail commands and responses have a strange syntax, and responses also have a numeric code. In the following examples, you can see which ones use the actual commands and responses. The complete commands and responses are in the fourth part.

Commands and responses are case-insensitive, that is, commands and responses can be uppercase, lowercase or a mixture of both, but this is not necessarily the case for user email names, because some hosts are case-sensitive to user names. In this way, the SMTP implementation will keep the user's mailbox name unchanged and the host name is case-insensitive.

Commands and responses consist of ASCⅱII II alphabet. When the delivery service provides an 8-bit byte delivery channel, every 7-bit character is delivered correctly, and the most significant bit is filled with 0. When a common command or response format is specified, the parameters will be represented by strings in some similar languages, such as ""

Edit paragraph 3. SMTP process

This section provides some procedures in SMTP. The first one explains the basic sending process (defined as sending operation). Next, forwarding mail, confirming mailbox name and expanding mailing list, sending to terminal, and opening and closing exchange are described. At the end of this section is the explanation of interrupt and mail domain. The examples in this section are only part of the command and response sequence. See appendix f for a complete example.

3. 1. Mail

There are three steps in SMTP sending operation. The operation starts with the MAIL command and gives the identity of the sender. This is followed by a series of or more RCPT commands to give the receiver information, followed by a data command to list the contents of the sent mail, and finally a mail content indicator to confirm the operation.

The first step in this process is the mail command,

Mail & ltSP & gt sender: < lt reverse path & gt& ltCRLF & gt;;

This command tells the receiver that a new send operation has started. Please reset all state tables and buffers. It gives the reverse path for error information to return. If the request is received, the receiver returns a 250 OK reply. & lt reverse path & gt;; This includes not only the mailbox, but also the reverse route between the host and the source mailbox, where the first host is the host that sent this command.

The second step of this process is to send the RCPT command.

RCPT <SP & gt Recipient: < LT Forward Path & gt& ltCRLF & gt;;

This command gives a forwarding path to identify the receiver, and if it is received, the receiver will return a.

250 OK reply, and store the forwarding path. If the receiver is unknown, the receiver will return 550 failure reply. This process can be repeated several times.

& lt forward path & gt;; It includes not only the mail, but also the routing table of the host and the destination mailbox, in which the first host is the host receiving the command. The third step of the process is to send a data command.

Data < crlf >;

If the command is received, the receiver returns to 354 for an intermediate reply and assumes that the following lines are the contents of the letter. When the end of the letter is received and stored, the receiver sends a 250 OK reply. Because the email was sent on the transmission channel, it is necessary to indicate the end of the email content so that the response dialogue can be restarted. SMTP indicates the end of e-mail content by sending only a period in the last line. At the receiving end, a process that is transparent to the user filters out this symbol so as not to affect the normal data.

Note: The contents of the email include the following tips: date, subject, recipient, cc and sender.

The message content indicator confirms the message operation and informs the receiver that the data can be stored and retransmitted. If the command is received, the receiver will return a 250 OK reply. Only when the mail operation is incomplete or the source is invalid will the data command fail.

The above process is a sending operation. These commands can only be used in the above order. The following example shows the usage of these commands in a send operation.

SMTP process example In this example, the host Smith..ARPA of Alpha sends an email to the Beta .. ARPA hosts of Jones, Green and Brown, assuming that the host Alpha is directly connected to the host Beta.

Sender:< Smith @ alpha ... ARPA & gt

Is 250 yuan all right?

S: RCPT to:< Jones @ beta ... ARPA & gt

Is 250 yuan all right?

History: RCPT to:< Green @ beta ... ARPA & gt

There are no such users here.

History: RCPT to:< Brown @ beta ... ARPA & gt

Is 250 yuan all right?

Student: Data.

R: 354 Start mail input; With < crlf >; . & ltCRLF & gt;

Student: Wait, wait, wait ...

Student: ... Wait.

s:& lt; CRLF & gt; . & ltCRLF & gt;

Is 250 yuan all right?

This letter was received by the first two people, and the third person has no mailbox on this host.

3.2. Move forward

Here are some

25 1: User is not local; Forward to

This reply means that the recipient SMTP knows that the user's mailbox is on another host, and it also means that the correct turning path will be used in the future. Please note that hosts and/or users are different. The receiver is responsible for transmitting the information.

55 1: User is not local, please try.

This reply means that the receiving SMTP knows that the user's mailbox is on another host and that the correct forwarding path is used. Please note that hosts and/or users are different. The receiver refuses to receive the letter from the user, and the sender must resend it according to the provided information or return an error message to the original sender. The following example shows the application of these responses.

Examples of forwarding

S: RCPT to: < USC-ISI ... ARPA & lt

R: 25 1 User is not local; Will be forwarded to< Southern California ISIF Post ... ARPA & gt

or

History: RCPT to:< Paul @ University of Southern California ISIB ... ARPA & gt

R: 55 1 User is not local; Please try< University of Southern California ISIF ... ARPA & gt

3.3. Confirmation and expansion

SMTP provides additional functions to confirm user names and expand mailing lists. These functions are accomplished by the VREF and EXPN commands, both of which take strings as parameters. For the VREF command, the string parameter refers to the user name, and the response to this command should include the user name and the user's mailbox. For the EXPN command, the string parameter refers to the mailing list, and there are multiple responses to this command, which should include the names of all users in the list and their mailboxes.

"User name" is an unnecessary item, which was added intentionally. If the host uses the VREF command and the EXPN command, the local mailbox must finally provide the user name for the host to confirm. It is also allowed if the host chooses another string as the user name.

In some hosts, the mailbox list and the proxy name of the mailbox are a little unclear, because the general data structure may include two types of entries. If you want to send a confirmation to the mailing list, you should give a clear answer. After receiving this message, the host will send the mail to all the addresses in the list, and if no confirmation response is received, an error will be reported. For example,

That's a mailing list, not a user name. If the request is used to extend the user name, a clear response can be formed by returning a list including the name, and if no clear response is received, an error will be reported. (For example, "550 is a user name, not a mailing list").

In the case of multiple responses (usually for EXPN), each response specifies a mailbox. In the case of fuzzy requests, such as "VRFY Smith", the response of the two smiths here must be "553 user unclear".

Confirm the user name, as shown in the following example: Example 3:

Confirm user name

Student: Fei Smith

R: 250 Fred Smith & lt Smith @ University of Southern California, ISIF ...

or

Student: Fei Smith

R: 25 1 User is not local; Will be forwarded to< Smith @ USC-ISIQ ... ARPA & gt

or

S: phil jones

R: 550 The string does not match anything.

or

S: phil jones

R: 55 1 User is not local; Please try< Jones @ USC -ISIQ. ,ARPA & gt

or

Student: VRFY Gourzenkyinplatz

R: 553 The user is not clear.

The mailbox list requires multiple responses, as shown in the following example:

Student: EXPN Example-People

R:250- Jon Postel < Southern California ISIF Post ...

r:250-Fred fone bone & lt; Fonebone@USC-ISIQ..ARPA & gt

R:250- Sam Q Smith & ltSQSmith@USC-ISIQ. ,ARPA & gt

R:250- Quincy Smith & lt@ University of Southern California, ISIF ... ARPA: Q-Smith @ ISI-VAXA ... ARPA & gt

r:250-& lt; joe@foo-unix..ARPA & gt

r:250 & lt; xyz@bar-unix..ARPA & gt

or

S: EXPN administration-restroom-list

R: 550 refused your visit.

The string command parameters of the VERF and EXPN commands can no longer be restricted because of their different implementations. On some systems, the parameter of the EXPN command may be the file name containing the mailing list, but there are many different file structures on the Internet.

The VRFY and EXPN commands are not included in the minimum implementation, and when they are implemented, they do not need to be implemented between transmissions.

Edit paragraph 3.4. Send letters and get letters.

The main purpose of SMTP is to send mail to the user's mailbox. A similar function provided by some hosts is to send mail to the user terminal (if the user is opening the terminal). Sending mail to the user's mailbox is called mailing; Sending it to the user terminal is called getting letters.

(Sending). Because these two implementations are very similar on some hosts, they are also.

It was put into SMTP. However, the command to get letters is not available in the minimal implementation of SMTP. Users should be able to control the writing of information to the terminal. Most hosts allow users to accept or reject similar information.

The following three commands are defined to support getting letters. They are used for mail commands, not mail.

Command, indicating the special significance of receiving SMTP:

Send & ltSP & gt sender: < lt reverse path & gt& ltCRLF & gt;;

The send command requires that the e-mail content be sent directly to the user terminal. If the user does not open the terminal (or

The user has not received the terminal information), 450 the response will return the RCPT command. If the information is sent successfully, the operation is successful.

SOML <SP & gt Sender: < Reverse path & gt& ltCRLF & gt;; ;

The Send or MaiL command requires that the e-mail content be sent directly to the user terminal (if the user is on the terminal). If the user is not on the terminal, the email content directly enters the mailbox. If the mail is sent to the user terminal or user mailbox, the sending operation is successful.

SAML & ltSP & gt sender: < lt reverse path & gt& ltCRLF & gt;;

The Send and MaiL commands require that the e-mail content be sent directly to the user terminal (if the user is on the terminal). In any case, letters will enter the mailbox. If the letter enters the mailbox, the sending operation is successful.

The responses used for MAIL commands are the same as those of these commands.

Edit paragraph 3.5. Open and close.

When the transmission channel is open, some information needs to be exchanged to determine the identity of both parties. The following command is

Used to open and close:

HELO & ltSP & gt& lt domain & gt& ltCRLF & gt;;

Exit & ltCRLF & gt;;

In the HELLO command, the host sends the command itself, which can be interpreted as: "Hello,

I am XX ".

Example of opening a connection

No.220 BBN Road UN ⅸ ... ARPA simple mail transmission service is ready.

Lucy: Hello, University of Southern California, ISIF .. Advanced Research Projects Agency of the US Department of Defense.

No.250 BBN Road UNⅸ ... Advanced Research Projects Agency, US Department of Defense.

Examples of closed connections

give it up

R: 221bbn-un ⅸ ... arpa service closes the transmission channel.

Edit paragraph 3.6. promote

The forwarding path may be in the following format: "@ONE, @TWO:JOE@THREE", here, ONE, TWO.

Three are hosts. This format is used to emphasize the difference between an address and a path. The mailbox is an absolute address, and the path is information about how to get there. These two concepts should not be confused.

Conceptually, the elements of the forwarding path are moved to the reply path as information from one SMTP server to another. The reply path is a reverse data source path, for example, from the location of the current information to the location of the initiator. When the SMTP server deletes its own label from the forwarding path and inserts it into the reply path, it must use a name that can be understood by its sending environment to prevent its name from being understood as a different name in different environments.

If the first element in the forwarding path of the information received by SMTP is not the sign of the SMTP, it will not be deleted from the forwarding path, but will be used to determine the SMTP server to be sent next. In any case, SMTP adds its own tag to the reverse path.

When using the source path, receiving SMTP receives and forwards the mail, and then sends it to another receiving SMTP server. The receiving server can accept or refuse to forward the mail of local users. Receiving SMTP changes command parameters by moving its own tag from the forwarding path to the beginning of the reply path. At this time, receiving SMTP becomes sending SMTP. It establishes a channel to this SMTP in the next forwarding path, and then it sends mail to this SMTP.

The first host on the reply path should be the host that sends SMTP commands, and the first host on the forwarding path should be the host that receives SMTP commands.

Note: Forward paths and reply paths appear in SMTP commands and responses, but not necessarily in letters.

At rest. In other words, there is no need for such a path, especially if this format appears in the To: field, the From: field and the Cc: field of the header.

If the SMTP server accepts the forwarding task, but later finds that the mail cannot be sent due to incorrect forwarding path or other principles, it must establish a "mail undeliverable" signal and send it to the sender of this letter.

The signal must be sent from the SMTP service of the host. Of course, the server should no longer report error messages. One way to prevent this error reporting cycle is to leave a blank in the reply path of the signaled mail command. When sending this information, it is allowed to leave the reply path blank. The reply path after the mail command is empty, as shown below:

Mail sender:<& gt

The following example shows a message that cannot be delivered. This message is a response to an error when an email sent from JOE on HOSTW passes through HOSTX and needs to pass through HOSTZ to reach HOSTY. The example we saw happened between HOSTX and HOSTY.

Examples of unsent mail messages

Mail sender:<& gt

Is 250 yuan all right?

S: RCPT to:< @ hostx ... ARPA: Joe @ hostw ... ARPA & gt

Is 250 yuan all right?

Student: Data.

R: 354 Send mail data to.

Student: Date:1October 23rd 811:22: 33.

Sender: SMTP@HOSTY .. Advanced Research Projects Agency, US Department of Defense.

S: to: JOE@HOSTW. Advanced Research Projects Agency of the U.S. department of defense.

Subject: mail system problems

Sorry, Joe, your message to Sam .. ARPA lost.

S: Horst ... ARPA said this:

S: "550 has no such user"

s:。

Is 250 yuan all right?

Frequently asked questions about editing this paragraph

What is SMTP? What's the role? Answer: SMTP is the abbreviation of Simple Mail Transfer Protocol, that is, Simple Mail Transfer Protocol. This is a protocol that provides effective and reliable e-mail transmission for exchanging messages between two mail servers.

2.TCP protocol is used for mail transmission between mail servers. Why is mail sometimes lost?

Answer: The SMTP protocol between mail servers uses TCP connection, which can ensure the accurate transmission of mail between mail servers. However, due to the failure of the mail server itself, such as insufficient mail space, the mail cannot be completely transmitted, resulting in losses.

3. Why doesn't the sender's user agent send the mail directly to the recipient's user agent, but transmits it through the mail server?

A: Due to the limitation of the user's computer performance, it is impossible to run the program of sending and receiving emails, and it is impossible to continuously run and connect to the Internet. Therefore, letters can only be temporarily stored in the mail server, and users can download them when needed.