Home  >  Article  >  Backend Development  >  RFC821-Simple Mail Transfer Protocol SMTP Chinese version-1_PHP tutorial

RFC821-Simple Mail Transfer Protocol SMTP Chinese version-1_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:27:17750browse

3.7. Domains Domains were recently introduced into the ARPA Internet mail system. Using domains changes the address space from a flat plain string hostname to a hierarchy of global addresses. The host is replaced by a domain name, and the starting host is a sequence of tuples, ordered by commas from most specific to most general. For example, "USC-ISIF.ARPA", "Fred.Cambridge.UK" and "PC7.LCS.MIT.ARPA" might be host-domain identifiers. Regardless of how the domain name is used in SMTP, only the official name can be used, not pseudonyms or nicknames. 3.8. Changing Roles The TURN command can be used to change the role of a program communicating on a transport channel. If program A is currently sending SMTP, after it sends the TURN command and receives the OK response (250), it changes to receiving SMTP. In the same way, Program B can also change from receiving SMTP to sending SMTP. To refuse the role change, the recipient can send a 502 as a response. Note: This command is optional. This command is generally not used when using the TCP transport channel. However, this command is useful when establishing a transmission channel is expensive. For example, this command can support the general public switched telephone system as the transmission channel. 4. SMTP description 4.1. SMTP commands 4.1.1. Command syntax SMTP commands define mail transmission or system functions defined by users. Its command is a string terminated by . In the case of parameters, the command itself is separated by and parameters. If there are no parameters, it can be directly connected to . The syntax format of the email must be consistent with the format of the receiving site. SMTP commands and responses are discussed below. The sending email operation involves different data objects, which are connected to each other by different parameters. The reply path is the parameter of the MAIL command, the forwarding path is the parameter of the RCPT command, and the email date is the parameter of the DATA command. These parameters or data objects must follow the command. This mode also requires different buffers to store these objects, that is, a reply path buffer, a forward path buffer, and a message content buffer. Certain commands create their own buffers, or cause the contents of one or more buffers to be cleared. HELLO (HELO) This command is used to send SMTP confirmation to receive SMTP. The parameter field includes the hostname from which SMTP is sent. Receive SMTP confirms receiving SMTP to Send SMTP via the connection confirmation command. The boot command and OK response confirm that sending and receiving SMTP has entered the initial state, that is, no operations are being performed and all status tables and buffers have been cleared. MAIL (MAIL) This command is used to start sending mail to multiple mailboxes. The parameter field includes the reply path. The return path includes an optional list of hosts and sender mailboxes. When there is a host list, it is a reply path source, which indicates that this mailbox is sent by the hosts in the list one by one (the first host is the last host to receive the email). This table also has source paths for returning non-delivery signals to the sender. Because each passing host address is added at the beginning of this table, it must use a name that is clear to the sending IPCE rather than the receiving IPCE (if they are not an IPCE). The reply path for some error messages may be empty. This command clears the reply path buffer, forwarding path buffer, and message content buffer, and inserts the reply path information for this command into the reply path buffer. RECIPIENT (RCPT) This command is used to determine the only recipient of the message content; multiple recipients will be specified by multiple this command. The forwarding path includes an optional host and a required destination mailbox. When a host list appears, this is a source path that indicates that mail must be sent to the previous host in the list. If receiving SMTP does not implement mail delivery and sending, information such as unknown local user (550) will be returned to the user. When a message is delivered, the delivery host must move its name from the beginning of the forwarding path to the end of the reply path. When the email finally reaches its destination, the receiving SMTP will insert its own name in its host email format into the destination email. For example, when an email with the following parameters is received by delivery host A, FROM: TO: will become the following form: FROM: TO:. This command causes it to be forwarded The path parameters are added to the forwarding path buffer. DATA (DATA) The recipient will use the line following the command as the email content. This command causes the message content following this command to be added to the message content buffer. Email content can include all 128 ASCII characters. The email content is terminated by a line containing only a period, which is the following character sequence: ".", which indicates the end of the email. The end of message content indicates that the recipient should now process the saved message content. This process will clear the contents of the reply path buffer, forwarding path buffer and message content buffer. If the operation is successful, the receiver must return an OK response; if it fails, it must also return a failure response.When the receiving SMTP receives a message, whether it is used for forwarding or the message has arrived at the destination, it must add a timestamp line at the beginning of the message content. This line indicates the receiving host and the sending host of the message. The identification of the host, and the time and date the message content was received. Forwarded letters will have multiple lines with such timestamps. When receiving SMTP for last-stop delivery, it will return the path information line inserted into the message. This line includes the information in the sent command. Here, last-stop delivery means that the mail will be delivered to the intended user, but in some cases, the mail may need further processing and be delivered by another mail system. It is possible that the mailbox in the return path is inconsistent with the actual mail sent. This may occur when a specific error handling mailbox needs to be sent instead of the sender of the mail. The above description shows that the final email content consists of a return path line, followed by one or more timestamp lines. Following these lines are the header and body information of the email content. Specific instructions are required when processing subsequent email data indicates partial success. This may occur when sending SMTP finds that when mail needs to be delivered to multiple users, it can only successfully send the information to some of them. In this case, an OK response must be sent to the DATA command, while the SMTP organization is receiving and sending a "Undeliverable Mail" message to the sender of the message. In this message, either a list of unsuccessful recipients is sent, or multiple unsuccessful recipients are sent, one at a time. All undeliverable mail messages are sent by the MAIL command. Return-Path: Received: from GHI.ARPA by JKL.ARPA; 27 Oct 81 15:27:39 PST Received: from DEF.ARPA by GHI.ARPA; 27 Oct 81 15: 15:13 PST  Received: from ABC.ARPA by DEF.ARPA ; 27 Oct 81 15:01:59 PST  Date: 27 Oct 81 15:01:01 PST  From: JOE@ABC.ARPA   Subject: Improved Mailing System Installed  To: SAM@JKL.ARPA 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 Parameters field contains a reply path that, if successful, will send the email to the terminal. The reply path includes an optional list of hosts and the sender's email address. When a host list appears, it means that this is a transmission path, and the mail is sent here through each host on this path (the first host on the list is the last host). This table is used to return non-delivery signals to the sender. Because each pass-through host address is added at the beginning of this table, it must use a name that is clear to the sending IPCE rather than the receiving IPCE (if they are not an IPCE). The reply path for some error messages may be empty. This command clears the reply path buffer, forwarding path buffer, and message content buffer, and inserts the reply path information for this command into the reply path buffer. SEND OR MAIL (SOML) This command is used to start a mail operation to transfer the mail content to one or more terminals, or to a mailbox. For each recipient, if the recipient's terminal is open, the email content will be delivered to the recipient's terminal, otherwise it will be delivered to the recipient's mailbox. The parameter field contains the reply path if the command was successful in sending the message to the terminal or mailbox. The reply path includes an optional list of hosts and the sender's email address. When the host list appears, it means that this is a transmission path, and the mail is sent here through each host on this path (the first host on the list is the last host). This table is used to return non-delivery signals to the sender. Because each pass-through host address is added at the beginning of this table, it must use a name that is clear to the sending IPCE rather than the receiving IPCE (if they are not an IPCE). The reply path for some error messages may be empty. This command clears the reply path buffer, forwarding path buffer, and message content buffer, and inserts the reply path information for this command into the reply path buffer. SEND AND MAIL (SAML) This command is used to start a mail operation to transfer the mail content to one or more terminals and to the mailbox. If the recipient's terminal is open, the email content will be delivered to the recipient's terminal and to the recipient's mailbox. The parameter field contains the reply path if the command succeeds if the message is successfully sent to the mailbox. The reply path includes an optional list of hosts and the sender's email address. When the host list appears, it means that this is a transmission path, and the mail is sent here through each host on this path (the first host on the list is the last host processed). This table is used to return non-delivery signals to the sender. Because each pass-through host address is added at the beginning of this table, it must use a name that is clear to the sending IPCE rather than the receiving IPCE (if they are not an IPCE). The reply path for some error messages may be empty.This command clears the reply path buffer, forwarding path buffer, and message content buffer, and inserts the reply path information for this command into the reply path buffer. RESET (RSET) This command indicates that the sending operation will be aborted. Any saved senders, recipients, and message contents SHOULD be discarded, all buffers and status tables SHOULD be cleared, and the receiver MUST return an OK response. VERIFY (VRFY) This command requires the recipient to confirm that the parameter is a user. If this is a username (already known), returns the user's full name and the specified email address. This command has no effect on the reply path buffer, forward path buffer, and message content buffer. EXPAND (EXPN) This command asks the recipient to confirm that the parameter specifies a mailing list, and if it is a mailing list, returns the members of the list. If this is a username (already known), returns the user's full name and the specified email address. This command has no effect on the reply path buffer, forward path buffer, and message content buffer. HELP (HELP) This command causes the recipient to send a help message to the sender of the HELP command. This command can take parameters and returns specific information as a response. This command has no effect on the reply path buffer, forward path buffer, and message content buffer. NOOP (NOOP) This command does not affect any parameters and commands that have been issued. It simply means that no action was taken and does not mean that the recipient sent an OK response. This command works on reply path buffer, forward path buffer and mail

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531889.htmlTechArticle3.7. Domain domains were recently introduced into the ARPA Internet mail system. Using domains changes the address space from a flat plain string hostname to a hierarchy of global addresses. Host...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn