The SMTP service extension SMTP provides a reliable and valid transmission mechanism for transmitting emails. Although it has been obvious to its role in more than a decade, it is essential to its functionality. Extended the SMTP service We introduce: including both envelopes and content in the message forwarded by SMTP. We write to write envelopes and conflicts, we can help understand with letters in life. (1) The SMTP envelope is easier to understand, which is transmitted as a series of SMTP protocol units, including the sender address, the transfer mode, and one or more recipient addresses. If you have unclear, please refer to the SMTP Protocol Standard. (2) As for the content, it is composed of two parts, part of the letterhead, part of the letter, the letterhead is composed of one one domain / value pair (one domain, one value), if the letter is structured If it is constructed in MIME. Content is fundamentally text, which is generally constructed by the ASCII code, but because of the use of MIME, this limit should be nor, but the letterhead is not, generally should always use the ASCII code. Although the SMTP protocol is a good agreement, it is still inevitable to its extension. This article mainly illustrates an extension method. Use this extension method, between the servers and users, can know each other to use each other, how much, If communicating. Here we want everyone to know a experience in the network protocol: the more parameters, the faster death; the less parameters, the more lasting. There are too many parameters, which is not conducive to use, unable to promote, and will be replaced by other agreements sooner or later. This is also in line with the scientific basic principle, simple. This shows that it must be careful when implementing. If you accidentally get it, it will not be able to provide any benefits at all. Let's take a look at the ehlo command, and the client that supports the SMTP service extension should start the SMTP session with the ehlo command, not the usual HELO command. If the server is also supported, then returns a confirmation response, if you do not support, return the failure response. Because the ehlo command is introduced, the first command starting at the session can be HELO or EHLO. Therefore, new parameters are introduced, so the SMTP's Mail from and RCPT TO command line can also be 512 bytes, but the length of introducing new parameters must be described so that the implementation is ready to buffer. The command format is as follows: EHLO-cmd :: = "EHLO" SP Domain CR LF is successful in the command, the server returns the code 250, if the failure returns code 550, if an error, returns 500, 501, 502, 504 or 421. Contrast the "SMTP Protocol Standard", the EHLO command can appear in the place where any Helo command appears, and send it again after successfully sending a helo or ehlo command to return the server to 503. Customers cannot cache any information returned by the server. It must be noted here that EHLO commands must be sent each time the SMTP extension service session is started. If the server can handle the EHLO command, it returns the code 250. In this way, the server and the customer are in the initial state, that is, all status tables and buffers are ready.
Usually this response is multi-line, each row response includes a keyword, if any, there is one or more parameters, the syntax of the response is as follows: EHLO-OK-RSP :: = "250" Domain [sp Greeting ] CR LF / ("250-" Domain [sp Greeting] cr Lf * ("250-" EHLO-LINE CR LF) "250" SP Ehlo-Line CR LF) Greeting :: = 1 *
Let's take a look at the format of these two commands: ESMTP-CMD :: = INNER-ESMTP-CMD [SP esmtp-parameters] cr Lf esmtp-parameters :: = esmtp-parameter * (sp esmtp-parameter) ESMTP-Parameter: : = esmtp-keyword ["=" esmtp-value] esmtp-keyword :: = (letter / number) * (letter / number / "-") ESMTP-VALUE:: = 1 *
The SMTP service extension SMTP provides a reliable and valid transmission mechanism for transmitting emails. Although it has been obvious to its role in more than a decade, it is essential to its functionality. Extended the SMTP service We introduce: including both envelopes and content in the message forwarded by SMTP. We write to write envelopes and conflicts, we can help understand with letters in life. (1) The SMTP envelope is easier to understand, which is transmitted as a series of SMTP protocol units, including the sender address, the transfer mode, and one or more recipient addresses. If you have unclear, please refer to the SMTP Protocol Standard. (2) As for the content, it is composed of two parts, part of the letterhead, part of the letter, the letterhead is composed of one one domain / value pair (one domain, one value), if the letter is structured If it is constructed in MIME. Content is fundamentally text, which is generally constructed by the ASCII code, but because of the use of MIME, this limit should be nor, but the letterhead is not, generally should always use the ASCII code. Although the SMTP protocol is a good agreement, it is still inevitable to its extension. This article mainly illustrates an extension method. Use this extension method, between the servers and users, can know each other to use each other, how much, If communicating. Here we want everyone to know a experience in the network protocol: the more parameters, the faster death; the less parameters, the more lasting. There are too many parameters, which is not conducive to use, unable to promote, and will be replaced by other agreements sooner or later. This is also in line with the scientific basic principle, simple. This shows that it must be careful when implementing. If you accidentally get it, it will not be able to provide any benefits at all. Let's take a look at the ehlo command, and the client that supports the SMTP service extension should start the SMTP session with the ehlo command, not the usual HELO command. If the server is also supported, then returns a confirmation response, if you do not support, return the failure response. Because the ehlo command is introduced, the first command starting at the session can be HELO or EHLO. Therefore, new parameters are introduced, so the SMTP's Mail from and RCPT TO command line can also be 512 bytes, but the length of introducing new parameters must be described so that the implementation is ready to buffer. The command format is as follows: EHLO-cmd :: = "EHLO" SP Domain CR LF is successful in the command, the server returns the code 250, if the failure returns code 550, if an error, returns 500, 501, 502, 504 or 421. Contrast the "SMTP Protocol Standard", the EHLO command can appear in the place where any Helo command appears, and send it again after successfully sending a helo or ehlo command to return the server to 503. Customers cannot cache any information returned by the server. It must be noted here that EHLO commands must be sent each time the SMTP extension service session is started. If the server can handle the EHLO command, it returns the code 250. In this way, the server and the customer are in the initial state, that is, all status tables and buffers are ready.
Usually this response is multi-line, each row response includes a keyword, if any, there is one or more parameters, the syntax of the response is as follows: EHLO-OK-RSP :: = "250" Domain [sp Greeting ] CR LF / ("250-" Domain [sp Greeting] cr Lf * ("250-" EHLO-LINE CR LF) "250" SP Ehlo-Line CR LF) Greeting :: = 1 *