📄 rfc772.txt
字号:
QUIT 221 INFORMATIONAL COMMANDS HELP 211, 214 500, 501, 502, 421 MISCELLANEOUS COMMANDS NOOP 200 500 421STATE DIAGRAMS Here we present state diagrams for a very simple minded MTP implementation. Only the first digit of the reply codes is used. There is one state diagram for each group of MTP commands. The command groupings were determined by constructing a model for each command and then collecting together the commands with structurally identical models. For each command there are three possible outcomes: "success" (S), "failure" (F), and "error" (E). In the state diagrams below we use the symbol B for "begin", and the symbol W for "wait for reply". 24 RFC 772 September 1980 Mail Transfer Protocol We first present the diagram that represents the most MTP commands: 1,3 +---+ ----------->| E | | +---+ | +---+ cmd +---+ 2 +---+ | B |---------->| W |---------->| S | +---+ +---+ +---+ | | 4,5 +---+ ----------->| F | +---+ This diagram models the commands: HELP, MRCP, MRSQ, NOOP, QUIT. 25 September 1980 RFC 772Mail Transfer Protocol A more complex diagram models the MAIL command: ---- 1 | | +---+ cmd -->+---+ 2 +---+ | B |---------->| W |---------->| E | +---+ +---+ -->+---+ | | | 3 | | 4,5 | -------------- ------ | | | | +---+ | ------------->| S | | | 1,3 | | +---+ | 2| -------- | | | | V | | | +---+ text +---+ 4,5 ----->+---+ | |---------->| W |---------->| F | +---+ +---+ +---+ Note that the "text" here is a series of lines sent from the sender to the receiver with no response expected until the last line is sent. (The last line must consist of only a single period.) 26 RFC 772 September 1980 Mail Transfer Protocol Finally we present a generalized diagram that could be used to model the command and reply interchange: ------------------------------------ | | Begin | | | V | | +---+ cmd +---+ 2 +---+ | -->| |------->| |---------->| | | | | | W | | S |-----| -->| | -->| |----- | | | | +---+ | +---+ 4,5 | +---+ | | | | | | | | | | | 1| |3 | +---+ | | | | | | | | | | | | ---- | ---->| F |----- | | | | | | | | +---+ ------------------- | | V End 27 September 1980 RFC 772Mail Transfer Protocol CONNECTION ESTABLISHMENT The MTP control connection is established via TCP/NCP between the receiver process port/socket L and the sender process port/socket U. This protocol is assigned the service port/socket 57 (71 octal), that is L=57. 28 RFC 772 September 1980 Mail Transfer ProtocolAPPENDIX A Example of MRSQ R (Recipients-first) This is an example of how MRSQ R is used. First the sender must establish that the receiver in fact implements MRSQ. S: MRSQ <CRLF> R: 200 OK, no scheme selected An MRSQ with a null argument always returns a 200 if implemented, selecting the default "scheme", i.e., none of them. If MRSQ were not implemented, a code of 4xx or 5xx would be returned. S: MRSQ R <CRLF> R: 200 OK, using that scheme All is well; now the recipients can be specified. S: MRCP TO:<Foo@Y> <CRLF> R: 200 OK S: MRCP TO:<Raboof@Y> <CRLF> R: 553 No such user here S: MRCP TO:<bar@Y> <CRLF> R: 200 OK S: MRCP TO:<@Y,@X,fubar@Z> <CRLF> R: 200 OK Note that the failure of "Raboof" has no effect on the storage of mail for "Foo", "bar" or the mail to be forwarded to "fubar@Z" through host "X". Now the message text is furnished, by giving a MAIL command with no "TO" argument. S: MAIL FROM:<waldo@A><CRLF> R: 354 Type mail, ended by <CRLF>.<CRLF> S: Blah blah blah blah....etc. etc. etc. S: <CRLF>.<CRLF> R: 250 Mail sent The mail text has now been sent to "Foo" and "bar" as well as forwarded to "fubar@Z". 29 September 1980 RFC 772Mail Transfer Protocol APPENDIX B Example of MRSQ T (Text-first) Using the same message as the previous example to establish that the receiver implements MRSQ. S: MRSQ ? <CRLF> R: 215 T Text first, please MRSQ is indeed implemented, and the receiver says that it prefers "T", but that needn't stop the sender from trying something else. S: MRSQ R <CRLF> R: 501 Sorry, I really can't do that It's possible that it could have understood "R" also, but in general it's best to use the "preferred" scheme, since the receiver knows which is most efficient for its particular site. S: MRSQ T <CRLF> R: 200 OK, using that scheme Scheme "T" is now selected, and the message text is sent by giving a mail command with no "TO" argument. S: MAIL FROM:<WALDO@A><CRLF> R: 354 Type mail, ended by <CRLF>.<CRLF> S: Blah blah blah blah....etc. etc. etc. S: <CRLF>.<CRLF> R: 250 Mail stored Now recipients can be specified. S: MRCP TO:<Foo@Y> <CRLF> R: 250 Stored mail sent S: MRCP TO:<Raboof@Y> <CRLF> R: 553 No such user here S: MRCP TO:<bar@Y> <CRLF> R: 250 Stored mail sent S: MRCP TO:<@Y,@X,fubar@Z> <CRLF> R: 200 OK 30 RFC 772 September 1980 Mail Transfer Protocol The text has now been sent to "Foo" and "bar" at host "Y" and will be forwarded to "fubar@Z" through host "X", and still remains stored. A new message can be sent with another MAIL/MRCP ... sequence, but a careful sender would reset the state using the exchange below. S: MRSQ ? <CRLF> R: 215 T Text first, please Which resets the state without altering the scheme in effect. 31
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -