{"id":143,"date":"2011-05-10T00:25:29","date_gmt":"2011-05-09T16:25:29","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=143"},"modified":"2011-08-17T16:30:06","modified_gmt":"2011-08-17T08:30:06","slug":"notes-about-rfc-1939","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2011\/05\/notes-about-rfc-1939\/","title":{"rendered":"Post Office Protocol &#8211; Version 3 \u9605\u8bfb\u6742\u8bb0"},"content":{"rendered":"<p>Post Office Protocol &#8211; Version 3 http:\/\/www.rfc-editor.org\/rfc\/rfc1939.txt<\/p>\n<p><ins datetime=\"2011-05-09T16:01:45+00:00\">   A POP3 session progresses through a number of states during its<br \/>\n   lifetime.  Once the TCP connection has been opened and the POP3<br \/>\n   server has sent the greeting, the session enters the AUTHORIZATION<br \/>\n   state.  In this state, the client must identify itself to the POP3<br \/>\n   server.  Once the client has successfully done this, the server<br \/>\n   acquires resources associated with the client&#8217;s maildrop, and the<br \/>\n   session enters the TRANSACTION state.  In this state, the client<br \/>\n   requests actions on the part of the POP3 server.  When the client has<br \/>\n   issued the QUIT command, the session enters the UPDATE state.  In<br \/>\n   this state, the POP3 server releases any resources acquired during<br \/>\n   the TRANSACTION state and says goodbye.  The TCP connection is then<br \/>\n   closed.<\/ins><\/p>\n<p>  Minimal POP3 Commands:<\/p>\n<p>     USER name               valid in the AUTHORIZATION state<br \/>\n     PASS string<br \/>\n     QUIT<\/p>\n<p>     STAT                    valid in the TRANSACTION state<br \/>\n     LIST [msg]<br \/>\n     RETR msg<br \/>\n     DELE msg<br \/>\n     NOOP<br \/>\n     RSET<br \/>\n     QUIT<\/p>\n<p>  Optional POP3 Commands:<\/p>\n<p>     APOP name digest        valid in the AUTHORIZATION state<\/p>\n<p>     TOP msg n               valid in the TRANSACTION state<br \/>\n     UIDL [msg]<\/p>\n<p>  POP3 Replies:<\/p>\n<p>     +OK<br \/>\n     -ERR<\/p>\n<p>   Example POP3 Session<\/p>\n<p>      S: <wait for connection on TCP port 110><br \/>\n      C: <open connection><br \/>\n      S:    +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us><br \/>\n      C:    APOP mrose c4c9334bac560ecc979e58001b3e22fb<br \/>\n      S:    +OK mrose&#8217;s maildrop has 2 messages (320 octets)<br \/>\n      C:    STAT<br \/>\n      S:    +OK 2 320<br \/>\n      C:    LIST<br \/>\n      S:    +OK 2 messages (320 octets)<br \/>\n      S:    1 120<br \/>\n      S:    2 200<br \/>\n      S:    .<br \/>\n      C:    RETR 1<br \/>\n      S:    +OK 120 octets<br \/>\n      S:    <the POP3 server sends message 1>\n      S:    .<br \/>\n      C:    DELE 1<br \/>\n      S:    +OK message 1 deleted<br \/>\n      C:    RETR 2<br \/>\n      S:    +OK 200 octets<br \/>\n      S:    <the POP3 server sends message 2>\n      S:    .<br \/>\n      C:    DELE 2<br \/>\n      S:    +OK message 2 deleted<br \/>\n      C:    QUIT<br \/>\n      S:    +OK dewey POP3 server signing off (maildrop empty)<br \/>\n      C:  <close connection><br \/>\n      S:  <wait for next connection><\/p>\n<p><ins datetime=\"2011-05-09T16:38:45+00:00\">   Responses to certain commands are multi-line.  In these cases, which<br \/>\n   are clearly indicated below, after sending the first line of the<br \/>\n   response and a CRLF, any additional lines are sent, each terminated<br \/>\n   by a CRLF pair.  When all lines of the response have been sent, a<br \/>\n   final line is sent, consisting of a termination octet (decimal code<br \/>\n   046, &#8220;.&#8221;) and a CRLF pair.  If any line of the multi-line response<br \/>\n   begins with the termination octet, the line is &#8220;byte-stuffed&#8221; by<br \/>\n   pre-pending the termination octet to that line of the response.<br \/>\n   Hence a multi-line response is terminated with the five octets<br \/>\n   &#8220;CRLF.CRLF&#8221;.  When examining a multi-line response, the client checks<br \/>\n   to see if the line begins with the termination octet.  If so and if<br \/>\n   octets other than CRLF follow, the first octet of the line (the<br \/>\n   termination octet) is stripped away.  If so and if CRLF immediately<br \/>\n   follows the termination character, then the response from the POP<br \/>\n   server is ended and the line containing &#8220;.CRLF&#8221; is not considered<br \/>\n   part of the multi-line response.<\/ins><\/p>\n<p><strong>POP3\u547d\u4ee4\u5b9e\u4f8b<\/strong><br \/>\ntelnet mail-host 110<\/p>\n<p>USER hello@example.com<\/p>\n<p>PASS 111111<\/p>\n<p>STAT<br \/>\n+OK 13 332023<\/p>\n<p>LIST<br \/>\n+OK POP3 clients that break here, they violate STD53.<br \/>\n1 202<br \/>\n2 73113<br \/>\n3 402<br \/>\n4 402<br \/>\n5 80267<br \/>\n6 13380<br \/>\n7 407<br \/>\n8 755<br \/>\n9 115473<br \/>\n10 16932<br \/>\n11 30343<br \/>\n12 169<br \/>\n13 178<br \/>\n.<\/p>\n<p>LIST 2<br \/>\n+OK 2 73113<\/p>\n<p>UIDL 3<br \/>\n+OK 3 uuxvo-13134583174281799<\/p>\n<p>RETR 1    #\u5e94\u8be5\u8fd4\u56de\u7b2c1\u5c01\u90ae\u4ef6\u7684\u6240\u6709\u5185\u5bb9<br \/>\n+OK<br \/>\nDate: Mon, 15 Aug 2011 14:37:42 +0800 (CST)<br \/>\nFrom:  <hello@example.com><br \/>\nTo: hello@example.com<br \/>\nMessage-ID: <6879346.11.1313450262952.JavaMail.root@knight><br \/>\nSubject: =?UTF-8?Q?=E6=B5=8B=E8=AF=952011=E5=B9=B48=E6=9C=881?=<br \/>\n =?UTF-8?Q?5=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=8014:37?=<br \/>\nMIME-Version: 1.0<br \/>\nContent-Type: multipart\/mixed; boundary=&#8221;&#8212;-=_Part_10_343799.1313390262951&#8243;<\/p>\n<p>&#8212;&#8212;=_Part_10_343799.1313390262951<br \/>\nContent-Type: text\/html;charset=gbk<br \/>\nContent-Transfer-Encoding: base64<\/p>\n<p>PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0<br \/>\nL2h0bWw7IGNoYXJzZXQ9Z2JrIj48dGl0bGU+PC90aXRsZT48L2hlYWQ+PGJvZHk+suLK1DIwMTHE<br \/>\n6jjUwjE1yNXQx8ba0rsxNDozNzxkaXY+suLK1DIwMTHE6jjUwjE1yNXQx8ba0rsxNDozNzwvZGl2<br \/>\nPjwvYm9keT48L2h0bWw+<br \/>\n&#8212;&#8212;=_Part_10_343799.1313390262951&#8211;<br \/>\n.<\/p>\n<p>DELE 1<br \/>\n+OK <\/p>\n<p>RSET<br \/>\n+OK <\/p>\n<p>TOP 2 3    #\u5e94\u8be5\u8fd4\u56de\u7b2c2\u5c01\u90ae\u4ef6\u7684\u90ae\u4ef6\u5934+\u524d3\u884c<br \/>\n+OK<br \/>\nDate: Tue, 16 Aug 2011 09:31:27 +0800 (CST)<br \/>\nFrom: noreply@example.com<br \/>\nTo: hello@example.com<br \/>\nMessage-ID: <27682895.1.1313458287431.JavaMail.root@SERVER2><br \/>\nSubject: =?gbk?B?PLLiytTNy9DFMjAxMcTqONTCMTbI1dDHxtq2\/jA5OjI3Ps22td3Kp7Dc?=<br \/>\nMIME-Version: 1.0<br \/>\nContent-Type: multipart\/mixed;<br \/>\n\tboundary=&#8221;&#8212;-=_Part_0_31571602.1313458287431&#8243;<\/p>\n<p>&#8212;&#8212;=_Part_0_31571602.1313458287431<br \/>\nContent-Type: text\/html;charset=gbk<br \/>\nContent-Transfer-Encoding: base64<br \/>\n.<\/p>\n<p>TOP 1    #\u5e94\u8be5\u8fd4\u56de\u7b2c1\u5c01\u90ae\u4ef6\u7684\u90ae\u4ef6\u5934<\/p>\n<p>QUIT    #\u65ad\u5f00\u8fde\u63a5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Office Protocol &#8211; Version 3 http:\/\/www.rfc-editor.org\/rfc\/rfc1939.txt A POP3 session progresses through a number of states during its lifetime. Once the TCP connection has been opened and the POP3 server has sent the greeting, the session enters the AUTHORIZATION state. In this state, the client must identify itself to the POP3 server. Once the client &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2011\/05\/notes-about-rfc-1939\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Post Office Protocol &#8211; Version 3 \u9605\u8bfb\u6742\u8bb0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[8],"tags":[11],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-paste","tag-mail"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=143"}],"version-history":[{"count":9,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":291,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/143\/revisions\/291"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}