RFC821-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 sub-system 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 the process of connecting to different IPCE. More particularly, the message can be transmitted through host Press in different networks.
2. SMTP model
SMTP design is based on the following communication model: Send SMTP to establish a bidirectional transfer channel between the SMTP establishment and the receiving SMTP for the user's mail request. The receiving SMTP can be the final recipient or the intermediate transmitter. The SMTP command is sent by the send 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. The special sequence will be received when the recipient receives all the emails. If the recipient successfully processes the message, the OK answer 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 a relativity force 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 forward 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. Command and response to case sensitive, that is, commands and responses can be uppercase, lowercase, or mix, but this is not necessarily pair of 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 a string similar to the language, such as "
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 open the shutdown exchange. 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,
Mail
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. The mailbox is included in
The second step in the process is to send the RCPT command.
RCPT
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.
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. Because the message is sent on the transfer channel, it must be indicated by the end of the message, so that the response conversation 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 response. 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, sent mail to the Beta.arpa host's SMIS, Green, and Brown, where host Alpha is directly connected to host Beta.
S: Mail from:
251: The user is not locally; will be sent 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 of them 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 reciprocity refuses to receive letters of this user, and the sender must resend according to the information provided or returns an error message to the original sender. The following example shows the application of these responses.
Forward examples S: rcpt to:
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 user name, and the response to this command includes the user's naming and user's mailbox. For the EXPN command, string parameters refers to a mailing list, more than one response to this command, which includes 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, email lists and emotions 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 respond. 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 the username S: VRFY Smith R: 250 Fred Smith
The mailbox list requires multiple responses, as shown in the following example: S: EXPN EXAMPLE-PEOPLE R: 250-Jon Postel
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 for mail commands instead of mail commands, indicating the special meaning of receiving this operation: Send
The Send command requires mail content to be transmitted directly to the user terminal. If the user does not turn on the terminal (or not receiving terminal information), the 450 response will return a RCPT command. This operation is successful if the information is successfully sent.
SOML
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
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
Example of closing links: quit r: 221 bbn-unix.arpa service closing Transmission channel
3.6. Forwarding forwarding paths 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, for example from the position of the current information to the position of the initiator. When an SMTP server deletes its own tag from the forwarding path and insert it into the reply path, it must use the name that it can understand can be used to prevent its name in a different environment being understood to be different. 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 received SMTP becomes sending SMTP, and the channel of SMTP in the next forwarding path is created, then it sends mail 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 the reply path appear in the SMTP command and 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 forward path is incorrect or other principles cannot send mail, it must establish a "undeliverable mail" signal, send it to the letter to this letter. This signal must be issued from the SMTP service of this host, of course, this server should not report an error in the error message. A condition that prevents this error report cycle is to set it on the backup 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 unpalatable message information is displayed in the following example. This information is a response to the message issued from Joe on HostW, which is in Hostx needs to respond when Hostz reaches Hosty. The example we see is between Hostx and Hosty.
Examples of unable to send mail information S: mail from: <> r: 250 ok s: rcpt to: <@ hostx.arpa :joe@hostw.arpa> r: 250 OK S: DATA R: 354 Send the mail data, end With. s: Date: 23 Oct 81 11:22:33 s: from: SMTP@hosty.arpa s: to: joe@hostw.Arpa s: Subject: Mail System Problem s: S: Sorry Joe, Your Message To Sam @ Hostz.arpa Lost. S: Hostz.arpa said this: s: "550 no so user" s:. R: 250 ok3.7. Domain domain is recently introduced to the ARPA Internet mail system. The domain can make the address space from a plane normal string host name into a hierarchy of the global address. The host consists of a domain name, and the starter is composed of a series of paracels, which are arranged in the most special order by a comma. For example, "USC-ISIF.ARPA", "Fred.cambridge.uk" and "PC7.lcs.mit.arpa" may be a host-domain identifier. Regardless of how the domain name is used in SMTP, only formal names can be used, and a pseudonym or nickname cannot be used.
3.8. Change the role TURN command to change the role of the program that communicates on the transfer channel. If the program A is now sending SMTP, it sends a TURN command and receives the OK answer (250), it will turn the SMTP. The same, program B can also become SMTP from the receiving SMTP. To refuse to change the role, the recipient can send 502 as a response. Note: This command is optional. This command is generally not used when the transfer channel of the TCP is used. However, this command is useful when the cost of establishing a transmission channel is relatively large. For example, this command can support a common public switched telephone system as a transmission channel.
4. SMTP Description 4.1. SMTP Command 4.1.1. Command Syntax SMTP command defines mail transfer or by user-defined system features. Its command is a string ended by
Hello (hello) This command is used to confirm the transmit SMTP to the received SMTP. The parameter domain includes host names that send SMTP. Receive SMTP to confirm the receiving SMTP to the send SMTP by the connection confirmation command. The talent order and the OK respond to independently reported and receiving SMTP into the initial state, that is, no operation is being executed, all status tables and buffers have been removed.
Mail (Mail) This command is used to start sending messages into a plurality of mailboxes. The parameter domain includes a reply path. An optional host and sender mailbox list is included in the return path. When there is a list of hosts, it is a reply path source, which indicates that this mailbox is transmitted by the host in the table (the first host is the last host that receives this message). This table also has a source path to the sender returns a non-transfer signal. Because each delivery host address is added at this table, it must use the send IPCE instead of receiving IPCE (if they are not an IPCE) clear name. Some error messages may be empty. This command clears the reply path buffer, forward the path buffer, and the mail content buffer, and inserts the reply path information of this command into the reply path buffer. Recipient (RCPT) This command is used to determine the unique recipient of the message content; multiple recipients will be specified by multiple this command. An optional host and a must-purpose mailbox are included in the forwarding path. When a list of host appears, this is a source path, which indicates that the message must be sent to the previous host in the list. If the delivery transmission of the SMTP does not implement the message is received, information such as unknown local users (550) is returned to the user. When the message is transmitted, the transfer host must move his name by the beginning of the forwarding path to the end of the response path. When the message finally reaches the destination, the received SMTP will insert the target email with its host mailing format. For example, when a message received by the transfer host A, from:
The Data (DATA) recipient will follow the line after the command as the message content. This command causes the mail content after this command to join the mail content buffer. The email content can include all 128 ASCII code characters. The message content is ended by only a row of a period, that is, the following character sequence: "
This is to inform you That ...
SEND (send) This command is used to start a send command to send mail to one or more terminals. The parameter domain includes a reply path, and this command is sent to the terminal if successful. The reply path includes an optional host list and sender mailbox. When a host list appears, indicating this is a transfer path, the message is sent to each host on this path (the first host on the list is the last hand). This table is used to return non-transfer signals to the sender. Because each delivery host address is added at this table, it must use the send IPCE instead of the IPCE (if they are not an IPCE) clear name. The reply path of some error messages may be empty. This command clears the reply path buffer, forward the path buffer, and the mail content buffer, and inserts the reply path information of this command into the reply path buffer. Send or Mail (SOML) This command is used to start a mail action to transfer the message content to one or more terminals, or transferred to the mailbox. For each recipient, if the recipient terminal is opened, the mail content will be transferred to the recipient's terminal, otherwise it is sent to the recipient's mailbox. The parameter domain includes a reply path, which is successfully sent to the terminal or mailbox. The reply path includes an optional host list and sender mailbox. When a host list appears, it is a transmission path, and the message is sent to each host on this path (the first host on the list is the last hand). This table is used to return non-transfer signals to the sender. Because each delivery host address is added to this table start, it must be clearly used by sending IPCE instead of receiving IPCE (if they are not an IPCE) clear name. The reply path of some error messages can be empty. This command clears the reply path buffer, forward the path buffer, and the mail content buffer, and inserts the reply path information of this command into the reply path buffer.
Send and mail (SAML) This command is used to start a mail action to transfer the message content to one or more terminals, and transfer it to the mailbox. If the recipient terminal is opened, the message content will be transferred to the recipient's terminal and the receiver's mailbox. The parameter domain includes a reply path, and if the information is successfully sent to the mailbox, this command is successful. The reply path includes an optional host list and sender mailbox. When a host list appears, it is a transmission path, and the message is sent to each host on this path (the first host on the list is the last hand). This table is used to return non-transfer signals to the sender. Because each delivery host address is added to this table start, it must be clearly used by sending IPCE instead of receiving IPCE (if they are not an IPCE) clear name. The reply path of some error messages can be empty. This command clears the reply path buffer, forward the path buffer, and the mail content buffer, and inserts the reply path information of this command into the reply path buffer.
RESET (RSET) This command indicates that the mail will be given. Any saved sender, recipient, and mail memory should be discarded, all buffers and status tables should be cleared, and the recipient must return to the OK response.
Verify (vrfy) This command requires the recipient to confirm that the parameter is a user. If this is (already known) user name, return to the user's full name and the specified mailbox. This command does not affect the reply path buffer, forwarding path buffers, and mail content buffers.
Expand (EXPN) This command requires the recipient to confirm the parameter specified a message send a list. If it is a mail sends a list, it returns a member in the table. If this is (already known) user name, return to the user's full name and the specified mailbox. This command does not affect the reply path buffer, forwarding path buffers, and mail content buffers. Help (help) This command causes the recipient to send help information to the sender of the HELP command. This command can take parameters and return to specific information as a response. This command does not affect the reply path buffer, forwarding path buffers, and mail content buffers.
NOOP (Noop) This command does not affect any parameters and commands already issued. It simply shows that there is no operation instead of that the recipient sends an OK response. This command does not affect the reply path buffer, forwarding path buffers, and mail content buffers.
Quit (quit) This command indicates that the recipient must send an OK answer and close the transfer channel. The recipient should not close the communication channel before receiving the Quit command and respond. The sender should not turn off the channel before sending a quit command and receiving a response. Even if an error, the channel should not be closed. If the connection is closed in advance, the recipient should cancel all waiting operations like the RSET command, but does not restore the original already doing. The sender should assume that commands and operations are still supported like they receive temporary error (4xx).
TURN (TURN) This command specifies that the recipient either sends an OK response and changing the role to send SMTP, or send a rejection of information and keep your own role. If the program A is now sent SMTP, it issues the TURN command to receive the OK (250) response, which turns into the receiving SMTP. Program A enters the initial state, as if the communication channel is just open, then it sends 220 to prepare the service signal. If the program B is now receiving SMTP, it will receive the OK (250) response after the TURN command, which turns into the SMTP. Program A enters the initial state, as if the communication channel is just open, then it is ready to receive 220 to prepare the service signal. To refuse to change the role, the recipient can send 502 answers. There is a certain limit for the order of these commands. The first command of the conversation must be a hello command, which can be used in the session thereafter. If the parameter of the hello command is unacceptable, it must be returned to a 501 failed response, and the received SMTP must remain in a state of just consistent. NOOP, HELP, EXPN, and VRFY commands can be used at any time at any time. Mail, Send, SOML or SAML command starts a mail operation. Once started, you will send RCPT and DATA commands. Mail operation can be terminated by the RSET command. There may be one or more operations in a session. If the operation start parameter is unacceptable, 501 failed response must be returned, and the received SMTP must remain in a state in which it is just consistent. If the command order in the operation is wrong, 503 must be returned, and the received SMTP must be kept in a state in which it is just consistent. The last command of the session must be a quit command. This command cannot be used at other times of the session.
4.1.2. Command Grammar Format
The command consists of the command code and the subsequent parameter domain. The command code is four letters, and the case is not different. Because the following commands are the same: Mail Mail Mail Mail Mail This is also applicable for tags that boot any parameter values, such as TO and TO are the same. The command code and parameters are separated by one or more spaces. However, parameters in the reply path and forwarding path are case sensitive. Especially on some hosts, "smith" and "smith" are not a user. The parameter domain consists of unregulated strings, which is ended by
|
:: = All AZ 52 case English letters : = not included
The format of the timestamp line and the return path row is usually defined below:
Timestam line example received: from abc.arpa by xyz.arpa; 22 oct 81 09:23:59 pdt receif; 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子 帖子09:23:59 PDT
4.2. SMTP response is diverse to the SMTP command, it determines synchronization of requests and processing during mail transmission, but also ensures that the transmission SMTP knows the status of receiving SMTP. Each command must have only one response. The SMTP response consists of three digits, followed by text. The number help determines the next state that should be entered, and the text is meaningful to people. The three response already includes enough information, no need to read the text, the text can directly abandon or pass to the user. In particular, the text is related to the reception and environment, so the text received each time may be different. All of the response codes can be seen in Appendix E. Regular cases, the response consists of the following sequence: three digits,
Using the prefix "P" preceded before possible (not used in SMTP), "I" means that the "S" means success, "f" means fail, "e" means error. If the STMP recipient must turn off the channel, you can make 421 (service unavailable, shut down) response to any command. This table is based on the state shown below: Connection Establishments S: 220 F: 421 Helo S: 250 E: 500, 501, 504, 421 Mail s: 250 f: 552, 451, 452 E: 500, 501, 421 RCPT S: 250, 251 F: 550, 551, 552, 553, 450, 451, 452 E: 500, 501, 503, 421 DATA I: 354 -> Data -> S: 250 f: 552, 554 , 451, 452 F: 500, 501, 503, 421 RSET S: 250 E: 500, 501, 504, 421 Send S: 250 F: 552, 451, 452 E: 500, 501, 502, 421 SOML S: 250 F: 552, 451, 452 E: 500, 501, 502, 421 Saml s: 250 F: 500, 451, 452 E: 500, 501, 502, 421 VRFY S: 250, 251 f: 550 , 551, 553 E: 500, 501, 502, 504, 421 Expn s: 250 F: 550 E: 500, 501, 502, 504, 421 Help S: 211, 214 E: 500, 501, 502, 504, 421 NOOP S: 250 E: 500, 421 Quit S: 250 F: 502 E: 500, 5034.4. Status Figure Sample diagram is a simple SMTP implementation, each set of commands have a state map . In the figure, only the first digit of the response code is used as a representative of the response. The command group is set to the command in structure mode after each command is established. There are three possible answers to each command: success (s), fail (F), and error (E). In the state, we start using the B representative, use W to wait for a response.
This state diagram uses the following command: Helo, Mail, RCPT, RSET, Send, SOML, SAML, VRFY, EXPN, HELP, NOOP, QUIT, TURN. Below is a more complex state diagram for Data commands:
Note: The message content here is multi-line, and the recipient can only send an answer when the last line can be received. 4.5. Details 4.5.1. Minimum implementation is to make SMTP work, for the recipient, this is the minimum command that should be implemented: Commands - Helo Mail Rcpt Data Rset Noop Quit
4.5.2. Transparency does not have a guarantee of data transparency, and errors occur when sending similar "
Appendix A TCP Transport Service
Transmission Control Protocol (TCP) is used in ARPA Internet and complies with the US DOD standard for the network protocol. The SMTP Transport Channel connection is built on port U and the port L of the receiving process. A single full-duplex system is used for transmission. The service port specified for this protocol is 25, that is, L = 25. TCP connection supports transmission of 8-bit bytes, while SMTP only needs to transmit 7 bits; thus, the highest bit of each 8-bit character is set to 0.
Appendix B NCP Transport Service
ArpaNet Host - Host Protocol (implemented by network control) can also be used in Arpanet. The SMTP Transport Channel connection is built on port U and the port L of the receiving process; thereafter, a pair of simple connections are established according to the initial connection protocol (ICP). This pair of simple connections are used as transport channels. This protocol is designated as a connecting socket 25, that is, L = 25. NCP connection supports transmission of 8-bit bytes, while SMTP only needs to transmit 7 bits; thus, the highest bit of each 8-bit character is set to 0.
Appendix C NITS
You can also use a network independent transfer service. The transmission channel is established between the NITS in the transmission process and the reception process. The send process executes the primitive primitive and then waits for acceptance of Accept primitives. NITS connection supports transmission of 8-bit bytes, while SMTP only needs to transmit 7 bits; thus, the highest bit of each 8-bit character is set to 0.
Appendix D X.25 Transport Service
The X.25 service received directly directly using the public data network, however, it is recommended to use a reliable end-to-end protocol such as TCP. Appendix E response code composition
The three responses have a specific meaning. Each response indicates whether it is successful, failed or not completed. Through this bit, the untruritable SMTP will determine the next step, if the sender wants to know what problems, it can detect the second bit, and the third bit saves the last more complete information. That is, from the first bit to the third bit, the recipient can determine the status of the receiver than one step. There are five possible representation of the first one to represent different meaning:
1YZ part completion response
The command is accepted, but the required operation is aborted, and the reason is in the reply code. The sender should send another command to indicate whether to continue, or abandon the operation.
2YZ full completion response
The required operation has been completed, and another new request can be started.
3YZ needs to complete the completion of the completion of the information
The command is accepted, but the required operation is aborted, and further information is required. The sender should send another command to indicate further information.
4YZ is temporarily unfinished
The command is not accepted, and the required operation has not been executed, but the state of the error occurs is temporary, and the operation can be processed again. The sender should return the start command of the command sequence (if any). It is difficult to explain this temporary meaning, especially for two different sites. The difference between the difference is that the method belongs to some or the next type is: if you can repeat any change in any change, it is this class, if not, it is the next type (5yz).
5YZ permanently unfinished response
The command is not accepted, and the required operation is not completed. The repetition of the command does not work. Even if some error conditions have changed, the user has no need to try again, and it is desirable to operate again in the future.
The second sense of the response has the following categories:
X0Z Syntax: This type of response is for the following: syntax errors; in compliance, the command is not in function; unfinished or redundant commands.
X1Z information: This type of response is used to request information, such as status, or help information.
X2Z connection: This type of response is about the transmission channel.
X3z is not used.
X4z is not used.
X5Z Mail System: This type of response indicates the status of the recipient mail system for request transmission or other operation.
The third one gives a more detailed description. The listed response illustrates this. The text response is recommended, rather than necessarily, which can vary depending on the situation. On the other hand, the responses must be strictly followed by this section. The recipient should not create a new code because of a slightly different cases without using the already defined code. For example, if there is a NOOP command, if it successfully executes it, you don't have to return any new information, just return 250 answers. When the transmitted command requires an unforgettable site specified, the response should be 502. The answer text may be more than one line; in this case, the text must be marked, and the part of the receiving text is not read less than a line of data. This requires a specific format to explain multiple lines. This format is: Each line, in addition to the last line, add a "-" starting with the answer size. The last line begins with the answer to the answer code. Such examples:
123-first line
123-Second Line
123-234 Text Beginning with Numbers
123 The last line
Normally, the received party can only use the line of the answer to the response code to add space, and ignore the contents of the previous row. In special cases, the sender must know the content of the response text. At this time, the received response can be correctly determined by the case where the text is needed to know the text. Appendix F Some examples
This section provides a complete example of some SMTP sessions.
Typical SMTP operation
This type of display is sent by SMITH on USC-ISIF and SMIS, Green, and Brown on the BBN-UNIX host. Here, we assume that the USC-ISIF host is directly connected to the BBN-UNIX host. Jones and Brown receive mail, while Green has no email on BBN-UNIX.
R: 220 BBN-Unix.Arpa Simple Mail Transfer Service Ready
S: Helo USC-ISIF.ARPA
R: 250 BBN-Unix.Arpa
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. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 BBN-Unix.Arpa Service Closing Transmission Channel
Abandon SMTP operation
R: 220 mit-multics.Arpa Simple Mail Transfer Service Ready
S: Helo ISI-VAXA.ARPA R: 250 mit-multics.Arpa
S: Mail from:
R: 250 ok
S: rcpt to:
R: 250 ok
S: rcpt to:
R: 550 No Such User Here
S: Rset
R: 250 ok
S: quit
R: 221 Mit-multics.Arpa Service Closing Transmission Channel
forward mail
Step 1: Source hosts to forwarding hosts
R: 220 USC-ISIE.ARPA SIMPLE MAIL TRANSFER Service Ready
Helo mit-ai.arpa
R: 250 USC-ISIE.ARPA
S: Mail from:
R: 250 ok
S: RCPT TO: <@ USC-isie.arpa:jones@bbn-vax.arpa>
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: Date: 2 nov 81 22:33:44
S: from: john q. public
S: Subject: The next meetings of the board
S: TO: Jones@bbn-vax.arpa
S:
S: Bill: s: the next metreen of the board of directors will be
S: on Tuesday.
S: John.
S:.
R: 250 ok
S: quit
R: 221 USC-ISIE.ARPA Service Closing Transmission Channel
Step 2: Forwarding the host to the destination host
R: 220 BBN-vax.Arpa Simple Mail Transfer Service Ready
S: Helo USC-ISIE.ARPA
R: 250 bbn-vax.arpa
S: mail from: <@ USC-isie.Arpa :jqp@mit-ai.arpa>
R: 250 ok
S: rcpt to:
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: RECEIVED: from mit-ai.arpa by usc-isie.arpa;
2 Nov 81 22:40:10 UT
S: Date: 2 nov 81 22:33:44
S: from: john q. public
S: Subject: The next meetings of the board
S: TO: Jones@bbn-vax.arpa
S:
S: Bill:
S: The next meetings of the board of directors Will Be
S: on Tuesday.
S: John.
S:.
R: 250 ok
S: quit
R: 221 USC-ISIE.ARPA Service Closing Transmission Channel
Confirmation and send
R: 220 Su-Score.arpa Simple Mail Transfer Service Ready
Helo mit-mc.arpa
R: 250 Su-Score.arpa
S: VRFY CRISPIN
R: 250 Mark Crispin
S: Send from:
R: 250 ok
S: rcpt to:
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 Su-score.arpa Service Closing Transmission Channel
Get and send the email First determine the user name, then try to send the message to the user terminal, send it to the user's mailbox when it fails.
R: 220 Su-Score.arpa Simple Mail Transfer Service Ready
Helo mit-mc.arpa
R: 250 Su-Score.arpa
S: VRFY CRISPIN
R: 250 Mark Crispin
S: Send from:
R: 250 ok
S: rcpt to:
R: 450 USER NOT ACTIVE NOWS: RSET
R: 250 ok
S: Mail from:
R: 250 ok
S: rcpt to:
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 Su-score.arpa Service Closing Transmission Channel
More effective practices of the above problems
R: 220 Su-Score.arpa Simple Mail Transfer Service Ready
Helo mit-mc.arpa
R: 250 Su-Score.arpa
S: VRFY CRISPIN
R: 250 Mark Crispin
S: SOML from:
R: 250 ok
S: rcpt to:
R: 250 User NOT Active Now, SO Will Do Mail.
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 Su-score.arpa Service Closing Transmission Channel
Mail list First, each of the two mailing lists extends on different sessions of different hosts, and then send mail by forwarding the host to the user on the list.
Step 1: Extend the first list
R: 220 mit-ai.arpa Simple Mail Transfer Service Ready
S: Helo Su-score.arpa
R: 250 mit-ai.arpa
S: EXPN EXAMPLE-PEOPLE
R: 250-
R: 250-Fred Fonebone
R: 250-Xenon Y. zither
R: 250-Quincy Smith <@ USC-ISIF.ARPA: Q-SMITH@isi-vaxa.arpa>
R: 250-
R: 250
S: quit
R: 221 mit-ai.arpa service closing transmission channel
Step 2: Expand the second list
R: 220 mit-mc.arpa Simple Mail Transfer Service Ready
S: Helo Su-score.arpa
R: 250 mit-mc.arpa
S: EXPN INTERESTED-Parties
R: 250-al Calico
R: 250-
R: 250-quincy smith <@ USC-isif.arpa: Q-SMITH@isi-vaxa.arpa> r: 250-
R: 250
S: quit
R: 221 mit-mc.arpa service closing transmission channel
Step 3: Send mail by forwarding the host to all users included in the two lists
R: 220 USC-ISIE.ARPA SIMPLE MAIL TRANSFER Service Ready
S: Helo Su-score.arpa
R: 250 USC-ISIE.ARPA
S: Mail from:
R: 250 ok
S: rcpt to: <@ USC-isie.arpa: Abc@mit-mc.arpa>
R: 250 ok
S: rcpt to: <@ USC-isie.arpa :Fonebone@usc-isiqa.arpa>
R: 250 ok
S: rcpt to: <@ USC-isie.Arpa :xyz@mit-ai.arpa>
R: 250 ok
S: RCPT
To: <@ usc-isie.arpa, @ usc-isif.arpa: Q-SMITH@isi-vaxa.arpa>
R: 250 ok
S: RCPT TO: <@ USC-isie.arpa:joe@foo-unix.arpa>
R: 250 ok
S: rcpt to: <@ usc-isie.arpa :xyz@bar-unix.arpa>
R: 250 ok
S: rcpt to: <@ USC-isie.arpa :fred@bbn-unix.arpa>
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 USC-ISIE.ARPA Service Closing Transmission Channel
Forward situation
R: 220 USC-ISIF.ARPA SIMPLE MAIL TRANSFER Service Ready
S: Helo LBL-Unix.Arpa
R: 250 USC-ISIF.ARPA
S: Mail from:
R: 250 ok
S: rcpt to:
R: 251 User Not Local; Will Forward to
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 USC-ISIF.ARPA Service Closing Transmission Channel
Step 1: Try the first mailbox on the host
R: 220 USC-ISIF.ARPA SIMPLE MAIL TRANSFER Service Ready
S: Helo LBL-Unix.Arpa
R: 250 USC-ISIF.ARPA
S: Mail from:
R: 250 ok
S: rcpt to:
R: 251 User Not Local; Will Forward to
S: Rset
R: 250 ok
S: quit
R: 221 USC-ISIF.ARPA Service Closing Transmission Channel
Step 2: Try the mailbox on the second host
R: 220 USC-ISI.ARPA SIMPLE MAIL TRANSFER Service Ready
S: Helo LBL-Unix.Arpa
R: 250 USC-ISI.ARPA
S: Mail from:
R: 250 ok
S: RCPT TO:
R: OK
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 USC-ISI.Arpa Service Closing Transmission Channel
Many recipients
R: 220 Berkeley.Arpa Simple Mail Transfer Service Ready
S: Helo USC-ISIF.ARPA
R: 250 Berkeley.arpa
S: Mail from:
R: 250 ok
S: rcpt to:
R: 250 ok
S: rcpt to:
R: 552 Recipient Storage Full, Try Again in Another Transaction
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: Mail from:
R: 250 ok
S: rcpt to:
R: 250 ok
S: Data
R: 354 Start Mail INPUT; End with
S: Blah Blah Blah ...
S: ... etc. Etc. Etc. ETC.
S:.
R: 250 ok
S: quit
R: 221 Berkeley.Arpa Service Closing Transmission Channel
Name:
ASCII US standard information exchange code
Host has SMTP processes or mailbox network computers
Send the SMTP process with the process that is working with the SMTP process. Send SMTP to start the transfer service connection, it issues a SMTP command, receive a response, and the transfer of mail
The user wants to get the mail service (or the process of being in the name of the person), and the recipient of the mail.
Session When a series of information exchanged when the channel is turned on
Transmission services are reliable for streaming data communication services. For example: NCP, TCP, NITS. Transport channels in sending SMTP and receiving a full-duplex for switching commands, answers, and mail content between SMTP
Character display string
Line with a "End of the End of
Acknowledges that the SMTP responds to a command (successful or unsuccessful) response to a command transmitted by the transmission channel by the transmission SMTP. The general format of the response is to add a message to a piece of text. Normally, the answer is used for the machine, and the text is used for human users.
Mail content a series of strings that meet the standard character sets of the ARPA Internet text information format
Email content end tag indicates a specific character ending with the end of the message
Mailbox Specifies what should be sent to the user's address (string). It is usually represented by the username and hostname
The command is sent by the sending SMTP to the request for a mail service operation for the receiving SMTP.
The level of the main unit address string in the domain mail system
The process of receiving the SMTP process works with the SMTP process. It waits to connect through the transfer service. It receives the command sent by sending the SMTP, gives an response and performs the corresponding operation.
Operation A series of operations from one recipient to another or more recipients