SMTP protocol specification (Chinese version)

zhaozj2021-02-08  212

Simple Mail Transfer Protocol (SMTP)

1. Introduction The goal of the Simple Mail Transfer Protocol (SMTP) is reliable and efficiently transmitting messages, which is independent of the transmit subsystem and only one channel that can guarantee the sequence of data units. Appendix A, B, C, and D describes the use of SMTP under different delivery services. The terminology used in this document is also defined in the noun table. An important feature of SMTP is that it can transfer emails in transmission, and the transfer service provides the process communication environment (IPCE), which can include a network, several networks, or a network of subnets. It is important to understand that the transfer system (or IPCE) is not one-on-one. The process may communicate directly with other processes through known IPCE. The email is an application or inter-process communication. The message can be sent across the network through a process on different IPCEs. More particularly, the message can be transmitted through host Press in different networks. 2. The SMTP model SMTP design is based on the following communication model: Send SMTP to establish a two-way transmission channel between the SMTP establishment and the receiving SMTP for the user's mail request. The receiving SMTP can be the final recipient or an intermediate transmitter. The SMTP command is sent by the sending SMTP, and the response is received, and the response is transmitted. Once the transfer channel is established, the SMTP sender sends a mail command to indicate the mail sender. If the SMTP recipient can receive an email, returns the OK answer. SMTP sender issues the RCPT command to confirm if the message is received. If the SMTP recipient is received, the OK response is returned; if you cannot receive it, you will issue a rejection receiving answer (but do not abort the entire mail operation), both parties will repeat multiple times. When the recipient receives all the emails, the special sequence will be received. If the recipient successfully processes the message, the OK response is returned. SMTP provides a mechanism for transferring mail. If the receiver is connected to the sender connection, the message can be transferred directly from the sender host to the receiver host; or when the two are not under the same transfer service, Follow the SMTP server. In order to be able to provide relay power for the SMTP server, it must have the final destination host address and mailbox name. The mail command parameter is the reply path. It specifies where the message is coming; and the parameter of the RCPT command is the forwarding path. It specifies where the message is deserved. The forward path is the source path, and the reply path is the return path (which is used to return mail when an error occurs). When the same message is to be sent to different recipients, SMTP encounters a problem with a replica that sends the same copy to different recipients. There is a quicker syntax, and there is a digital code. In the following, what can be seen in the examples using the actual commands and answers. Complete commands and responses in Section 4. Commands and response to case sensitive, that is, commands and responses can be uppercase, lowercase or mix of both, but this is not necessarily pair for user email name, because some hosts are case sensitive It is sensitive. In this way, the SMTP implementation retains the user's mailbox name to the initial sample, and the host name is not sensitive to case. Command and response consist of an ASCII alphabet that when the transfer service provides an 8-bit byte delivery channel, each 7-bit character is transmitted correctly, and the highest bit is filled with 0. When the general command or answering format is specified, the parameter is represented by some strings similar to the language, such as "

"or"

", Here anesthesia indicates that this is a variable similar to the language.

3. SMTP process This section provides some processes in SMTP. One illustrates the basic transmission process (defined as a transmission operation). Down describe the forward mail, confirm the mailbox name and extended mailing list, send it to the terminal and turn off. At the end of this section, an explanation of the interruption and mail field. Examples of this section are only part of the commands and responses, and the complete example see Appendix F. 3.1. Mail has three steps in the SMTP send operation, and the operation is given by the mail command to give the sender ID. A series of RCPT commands followed, and the recipient information is given, then the DATA command lists the sending message content, and the last message content indicator confirms the operation. The first step in the process is the mail command, includes a source mailbox. Mailfrom:

This command tells the recipient's new sending operation that has started, please reset all status tables and buffers. It gives the reverse path to return the error message. If the request is received, the recipient returns a 250 OK answer.

More than just include the mailbox, which includes the reverse route of the host and source mailbox, where the first host is a host that sends this command.

The second step in the process is to send the RCPT command. RCPT

TO:

This command gives a forward path identifier recipient. If the command is received, the recipient returns a 250 ok response and stores a forward path. If the recipient is unknown, the recipient returns a 550 Failure response. This process may repeat several times.

Not only includes mail, it is the routing table of the host and destination mailbox, but the first host in it is the host that receives the command.

The third step in the process is to send a DATA command. Data

If the command is received, the recipient returns a 354 Intermediate response and determines that the following lines are the contents of the letters. When the letter ends and stores, the recipient sends a 250 OK response. Since the message is sent on the transfer channel, you must indicate the end of the message content so that the response dialog can be restarted. SMTP indicates the end of the message content by transmitting only one period in the last line, in the receiver, a transparent process of the user, is filtered out to not affect normal data. Note: The email includes the following tips: Date, Subject, To, CC, from. The mail content indicator confirms the email operation and informs the recipient to store and send data. If this command is received, the recipient returns a 250 ok answer. The DATA command fails only if the mail operation is not completed or the source is invalid. The process described above is a transmission operation. These commands can only be used in the order above. The following example shows the use of these commands in a transmission operation. -------------------------------------------------- --------- SMTP Process Example This example is Jones, Green and Brown, send mail to the Beta.arpa host's SMIS, Green and Brown, where host alpha is directly connected to host Beta. S: Mail from:

R: 250 OK S: RCPT TO:

R: 250 OK S: RCPT TO:

R: 550 No Such User Here S: RCPT TO:

R: 250 OK S: DATA R: 354 Start Mail Input; End with

.

S: Blah Blah Blah ... s: ... etc. S:

.

R: 250 ok This letter is received by the first two, and the third person has no mailbox on this host. -------------------------------------------------- ----------- 3.2. Forward below is some

The address is incorrect in the middle destination, but the recipient knows an example of the correct destination address. In these examples, one of the following answers should allow the sender to obtain the correct address.

251: The user is not locally; will send it forward to

.

This response means that the recipient SMTP knows the user's mailbox on another host, and it means that the correct steering path will be used in the future. Please note that hosts or users, or both are different. The recipient is responsible for transmitting the message.

551: User is non-local, please try

This response means receiving SMTP knowing the user's mailbox on another host and means using the correct forwarding path. Note Please note that hosts or users, or both are different. The recipient refuses to receive the user's letters, and the sender must re-transmit according to the information provided or returned to the original sender back an error message. The following example shows the application of these responses. Forward example S: RCPT TO:

R: 251 User Not Local; Will Forward To

Or S: RCPT TO:

R: 551 USER NOT LOCAL; please try

-------------------------------------------------- ----------- 3.3. Confirmation and Extended SMTP provides additional ability to confirm the username and expand mailing list. These functions are done by the VREF and EXPN commands, which are parameters with strings. For the VREF command, the string parameter refers to the username, the response to this command to include the user's naming and user mailbox. For the EXPN command, the string parameter refers to a mailing list, more than one response to this command, which includes the user's naming and their mailboxes in all lists. "User Name" is a redundant project, it is intentionally plus. If the host uses the VREF command and the eXPN command, the last local mailbox must provide the user name to confirm it by the host. Allowable if the host selects a user name by another string as a username. In some hosts, the email list and the name of a mailbox are unclear because the general data structure may include two types of portals. If you want to issue a confirmation of the mailing list, you should give a determination response. After receiving this message, the host will transfer the message to all the addresses on the list. If you do not receive a determination response, an error will be reported. For example, "550 That IS A Mail List, Not a User Name". If the request is used to extend a username, it is possible to form a determination response by returning a list that includes a name, and if no determination response is received, an error is reported. (For example, "550 That 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 a fuzzy request, for example, "VRFY Smith", the response of the two Smith here must be "553 user ambiguous". Confirm that the username is as shown in the following example: Example 3: ------------------------------------- ------------------------ Confirm user name S: VRFY Smith R: 250 Fred Smith

Or S: VRFY Smith R: 251 User Not Local; Will Forward To

Or S: VRFY Jones R: 550 String Does Not Match Anything. Or S: VRFY Jones R: 551 User Not Local; please try

Or S: VRFY Gourzenkyinplatz R: 553 User Ambiguous. --------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------- Expand the mailing list Example S: EXPN EXAMPLE-PEOPLE R: 250-JON POSTERR: 250-FRED FONEBONE

R: 250-Sam Q. Smith

R: 250-Quincy Smith <@ USC-ISIF.ARPA: Q-SMITH@isi-vaxa.arpa> r: 250-

R: 250

or

S: EXPN EXECUTIVE-WASHROOM-LIST R: 550 Access Denied to you. ---------------------------------- --------------------------- VERF and EXPN commands The parameters cannot be limited by the specific implementation. On some systems, the parameters of the EXPN command may be a file name containing the mailing list, but there are many different file structures on the Internet. The VRFY and EXPN commands do not include the minimum implementation that they do not require inter-transmission between the transmitting when they are implemented. 3.4. The main purpose of the sending letter and the SEnding SMTP is to send mail to the user's mailbox. Similar functions provided by some hosts are to send emails to the user's terminal (if the user is turning on the terminal). Send a message to the user's mailbox, called a transmission letter; and send it to the user terminal called a letter. Because in some hosts, the implementation of both is very similar, so they are also placed in SMTP. However, obtaining the letter command is not in the minimum implementation of SMTP. Users should have the ability to control to write information to the terminal. Most hosts allow users to accept or reject similar information. The following three commands are defined to support access. They are used in the mail command instead of the mail command, indicating the special meaning of receiving this operation of SMTP: Send

From:

The Send command requires mail content to be transmitted directly to the user terminal. If the user does not turn on the terminal (or does not receive terminal information), the 450 response will return an RCPT command. This operation is successful if the information is successfully sent. SOML

From:

The Send or Mail command requests the message to send the message to the user's terminal (if the user is on the terminal). If the user is not in the terminal, the message content directly into the mailbox. If the message is sent to the user terminal or user mailbox, the transmission operation is successful. Saml

From:

The send and mail commands require mail content to be sent directly to the user terminal (if the user is on the terminal). Anyway, letters will enter the mailbox. If the letter enters the mailbox, the send operation is successful. The response of the mail command is the same as those of these commands. 3.5. Opening and closing When the transfer channel is turned on, exchange some information to determine the identity of both parties. The following command is used to open and close: Helo

Quit

In the Hello command, the host sends a command yourself, this command can be interpreted as: "Hello, I am XX". -------------------------------------------------- ----------- Example of opening coupled R: 220 bbn-unix.arpa Simple Mail Transfer Service Ready S: Helo USC-INIF.ARPA R: 250 BBN-UNIX.ARPA ------ -------------------------------------------------- ----- --------------------------------------------- ---------------- Close the connection: quit r: 221 bbn-unix.arpa service closing transmission channel --------------- -------------------------------------------- 3.6. Forward forwarding The path may be formatted: "@ one, @ two: joe @ Three", here, One, Two and Three are hosts. This format is used to emphasize the difference between addresses and paths. The mailbox is absolute address and the path is about how to arrive. These two concepts should not be confused. Conceptually, the element of the forwarding path is moved to the reply path as information from an SMTP server to another SMTP server. The reply path is a reverse data source path, such as from the location of the current information to the position of the initiator. When an SMTP server removes its own tag from the forwarding path and insert it into the reply path, it must use the name it can understand to prevent its name to prevent its name in a different environment is understood to be different. first name. This element is not deleted from the forwarding path when the first element of the forwarding path of the SMTP is not the SMTP tag, which is used to determine the SMTP server that the next should be sent. In any case, SMTP adds its own tag into the reverse path. When using the source path, receive SMTP receive forwarding messages and send it to another receiving SMTP server. The receiving server can accept or refuse to forward the local user's mail. Receive SMTP changes command parameters by moving its own tag from the beginning of the forwarding path to the response path. At this time, the receiving SMTP becomes the transmission SMTP, and the channel of the SMTP in the next forwarding path is established, and then it sends an email to this SMTP. One host on the reply path should be a host that sends the SMTP command, and the first host on the forwarding path should be a host that receives the SMTP command. Note: The forwarding path and reply path appear in the SMTP command and a response, but do not have to appear in the information. That is, there is no path in this form to "TO:", "from:", "from:", and "CC:", etc. in this path. If the SMTP server accepts forwarding tasks, but later it finds that the forwarding path is not correct or other principles cannot send mail, it must establish a "undeliverable mail" signal to send it to this letter to the letter. This signal must be issued from the SMTP service of this host. Of course, this server should not report an error in error information. A condition that blocks this error report cycle is to set it on the reply path of the signal's mail command. When this information is transferred, the reply path is allowed to be empty. The reply path after a mail command is empty as the following form: Mail from: <> The following example shows that the invoice information is displayed. This information is a response to the message issued from Joe on HostW, which is in Hostx needs to respond when Hostz reaches Hosty.

转载请注明原文地址:https://www.9cbs.com/read-3094.html

New Post(0)