SMTP service extension

zhaozj2021-02-08  446

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 * ehlo-line :: = ehlo-keyword * (sp ehlo-param) ehlo-keyword :: = (letter / number) * (letter / number / "-") EHLO-PARAM :: = 1 * < Character outside the space and control character> Alpha :: = Digit :: = <0 to 9> cr :: = lf :: = < Waiting, ASCII code 10> sp :: = Although the EHLO keyword can be uppercase, lowercase, uppercase mix, but the processing of it is sensitive, this is different from the original specified . IANA supports SMTP service extension registration, with a corresponding EHLO keyword value relative to each extension, and each service extension registered in IANA must be defined in an RFC. If a keyword begins in X, it refers to this service extension is the agreement between the two parties, not standard. If for some reason, the server cannot list the service extensions it support, and return to the code 554. After receiving this code, the customer either sends helo, or send the quit command. Sometimes the server receives the ehlo command, but the command parameter is unacceptable, it returns to the code 501. If the server identifies EHLO, the code 502 is returned to the server extension. Returns the code 421 if the server is no longer providing service extensions. After receiving this code, the customer either sends helo, or send the quit command. If the server does not support the service extension, return 500, the server holds an existing state, after receiving this code, the customer either sends helo, or send the quit command. Sometimes, the SMTP server will close the connection after a reason for some reason, this situation is not involved in the original SMTP protocol standard. In order to deal with this situation, the customer must be able to confirm if the server can work, it can be reconnected and sent to the HELO or EHLO command. Some servers will refuse to receive new Helo commands after receiving an EHLO command. At this time, you can use the RSET command to restart, then send Helo. If the customer doesn't pay attention to such small details, it will receive a failure code. Let's take a look at the Mail from and RCPT TO parameters. Many service extensions are implemented after the Mail from and the RCPT TO command is added.

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 * C: S: 220 dbc.mtview.ca.us SMTP Service Ready C: Ehlo Ymir.Claremont.edu S: 250 dbc.mtview.ca.us say Hello ... (2) The following is also an example: s: C: S: 220 dbc.mtview.ca.us SMTP Service Ready C: Ehlo Ymir.Claremont.edu S : 250-dbc.mtview.ca.us Says Hello S: 250-EXPN S: 250-Help S: 250-8bitmime s: 250-xone s: 250 xvrb ... This description server implements service extensions EXPN and HELP, Both are standard service extensions, and two are not standard in X-headed non-standard. (3) Finally, let's take a look at the server does not support service extensions: s: C: S: 220 dbc.mtview.ca.us SMTP Service Ready C: EHLO YMIR.CLAREMONT.EDU S: 500 Command Not Recognized: EHLO ... Code 500 indicates that the server does not support service extensions.

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 * ehlo-line :: = ehlo-keyword * (sp ehlo-param) ehlo-keyword :: = (letter / number) * (letter / number / "-") EHLO-PARAM :: = 1 * < Character outside the space and control character> Alpha :: = Digit :: = <0 to 9> cr :: = lf :: = < Waiting, ASCII code 10> sp :: = Although the EHLO keyword can be uppercase, lowercase, uppercase mix, but the processing of it is sensitive, this is different from the original specified . IANA supports SMTP service extension registration, with a corresponding EHLO keyword value relative to each extension, and each service extension registered in IANA must be defined in an RFC. If a keyword begins in X, it refers to this service extension is the agreement between the two parties, not standard. If for some reason, the server cannot list the service extensions it support, and return to the code 554. After receiving this code, the customer either sends helo, or send the quit command. Sometimes the server receives the ehlo command, but the command parameter is unacceptable, it returns to the code 501. If the server identifies EHLO, the code 502 is returned to the server extension. Returns the code 421 if the server is no longer providing service extensions. After receiving this code, the customer either sends helo, or send the quit command. If the server does not support the service extension, return 500, the server holds an existing state, after receiving this code, the customer either sends helo, or send the quit command. Sometimes, the SMTP server will close the connection after a reason for some reason, this situation is not involved in the original SMTP protocol standard. In order to deal with this situation, the customer must be able to confirm if the server can work, it can be reconnected and sent to the HELO or EHLO command. Some servers will refuse to receive new Helo commands after receiving an EHLO command. At this time, you can use the RSET command to restart, then send Helo. If the customer doesn't pay attention to such small details, it will receive a failure code. Let's take a look at the Mail from and RCPT TO parameters. Many service extensions are implemented after the Mail from and the RCPT TO command is added.

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

New Post(0)