📄 rfc788.txt
字号:
Postel [Page 5] November 1981 RFC 788Simple Mail Transfer Protocol ------------------------------------------------------------- Example of the SMTP Procedure This SMTP example shows mail sent by Smith at host Alpha, to Jones, Green, and Brown at host Beta. Here we assume that host Alpha contacts host Beta directly. S: MAIL FROM:<Smith@Alpha> R: 250 OK S: RCPT TO:<Jones@Beta> R: 250 OK S: RCPT TO:<Green@Beta> R: 550 No such user here S: RCPT TO:<Brown@Beta> R: 250 OK S: DATA R: 354 Start mail input; end with <CRLF>.<CRLF> S: Blah blah blah... S: ...etc. etc. etc. S: <CRLF>.<CRLF> R: 250 OK The mail has now been accepted for Jones and Brown. Green did not have a mailbox at host Beta. Example 1 -------------------------------------------------------------[Page 6] Postel RFC 788 November 1981 Simple Mail Transfer Protocol 3.2. FORWARDING There are some cases where the destination information in the <forward-path> is incorrect, but the receiver-SMTP knows the correct destination. In such cases, one the following replies should be used to allow the sender to contact the correct destination. 251 User not local; will forward to <forward-path> This reply indicates that the receiver-SMTP knows the user's mailbox is on another host and indicates the correct forward-path to use in the future. Note that either the host or user or both may be different. The receiver takes responsibility for delivering the message. 551 User not local; please try <forward-path> This reply indicates that the receiver-SMTP knows the user's mailbox is on another host and indicates the correct forward-path to use. Note that either the host or user or both may be different. The receiver refuses to accept mail for this user, and the sender must either redirect the mail according to the information provided or return an error response to the originating user. Example 2 illustrates the use of these responses. ------------------------------------------------------------- Example of Forwarding Either S: RCPT TO:<Postel@ISI> R: 251 User not local; will forward to <Postel@ISIF> Or S: RCPT TO:<Paul@ISIB> R: 551 User not local; please try <Mockapetris@ISIF> Example 2 -------------------------------------------------------------Postel [Page 7] November 1981 RFC 788Simple Mail Transfer Protocol 3.3. VERIFYING AND EXPANDING SMTP provides as additional features, commands to verify a user name or expand a mailing list. This is done with the VRFY and EXPN commands, which have a character string arguments. For the VRFY command, the string is a user name, and the the response may include the full name of the user and must include the mailbox of the user. For the EXPN command, the string identifies a mailing list, and the multiline response may include the full name of the users and must give the mailboxes on the mailing list. The case of verifying a user name is straightforward as shown in example 3. ------------------------------------------------------------- Example of Verifying a User Name Either S: VRFY Postel R: 250 Jon Postel <Postel@ISIF> Or S: VRFY Jones R: 550 String does not match anything. Example 3 -------------------------------------------------------------[Page 8] Postel RFC 788 November 1981 Simple Mail Transfer Protocol The case of expanding a mailbox list requires a multiline reply as shown in example 4. ------------------------------------------------------------- Example of Expanding a Mailing List Either S: EXPN Example-People R: 250-Jon Postel <Postel@ISIF> R: 250-Fred Fonebone <Fonebone@ISIQ> R: 250-Sam Q. Smith <SQSmith@ISIQ> R: 250-Quincy Smith <@ISIF,Q-Smith@ISI-VAXA> R: 250-<joe@foo-unix> R: 250 <xyz@bar-unix> Or S: EXPN Executive-Washroom-List R: 550 Access Denied to You. Example 4 ------------------------------------------------------------- The character string arguments of the VRFY and EXPN commands cannot be further restricted due to the variety of implementations of the user name and mailbox list concepts. On some systems it may be appropriate for the argument of the EXPN command to be a file name for a file containing a mailing list, but again there is a variety of file naming conventions in the internet. The VRFY and EXPN commands are not included in the minimum implementation (Section 4.5.1), and are not required to work across relays when they are implemented.Postel [Page 9] November 1981 RFC 788Simple Mail Transfer Protocol 3.4. SENDING AND MAILING The main purpose of SMTP is to deliver messages to user's mailboxes. A very similar service provided by some hosts is to deliver messages to user's terminals (provided the user is active on the host). The delivery to the user's mailbox is called "mailing", the delivery to the user's terminal is called "sending". Because in many hosts the implementation of sending is nearly identical to the implementation of mailing these two functions are combined in SMTP. However the sending commands are not included in the required minimum implementation (Section 4.5.1). User's should have the ability to control the writing of messages on their terminals. Most hosts permit the user's to accept or refuse such messages. The following three command are defined to support the sending options, these are used in the mail transaction instead of the MAIL command and inform the receiver-SMTP of the special semantics of this transaction: SEND <SP> FROM:<reverse-path> <CRLF> The SEND command requires that the mail data be delivered to the user's terminal. If the user is not active (or not accepting terminal messages) on the host a 450 reply may returned to a RCPT command. The mail transaction is successful if the message is delivered the terminal. SOML <SP> FROM:<reverse-path> <CRLF> The Send Or MaiL command requires that the mail data be delivered to the user's terminal if the user is active (and accepting terminal messages) on the host. If the user is not active (or not accepting terminal messages) then the mail data is entered into the user's mailbox. The mail transaction is successful if the message is delivered either to the terminal or the mailbox. SAML <SP> FROM:<reverse-path> <CRLF> The Send And MaiL command requires that the mail data be delivered to the user's terminal if the user is active (and accepting terminal messages) on the host. In any case the mail data is entered into the user's mailbox. The mail transaction is successful if the message is delivered the mailbox.[Page 10] Postel RFC 788 November 1981 Simple Mail Transfer Protocol The same reply codes that are used for the MAIL commands are used for these commands.Postel [Page 11] November 1981 RFC 788Simple Mail Transfer Protocol 3.5. OPENING AND CLOSING At the time the transmission channel is opened there is an exchange to ensure that the hosts are communicating with the hosts they think they are. The following two commands are used in transmission channel opening and closing: HELO <SP> <host> <CRLF> QUIT <CRLF> In the HELO command the host sending the command identifies itself; the command may be interpreted as saying "Hello, i am <host>". ------------------------------------------------------------- Example of Connection Opening
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -