  POP3
Post Office Protocol (POP) -          .  ,     POP     SMTP.  POP    SMTP,    .  .7   -   POP.  POP       .
       POP - 2  ,    ,     .   ,   2      .    ,    SMTP  ESMTP.        2 -    . 2    RFC 937 (Post Office Protocol-Version 2, Butler, et al, 1985), a  -  RFC 1225 (Post Office Protocol-Version 3, Rose, 1991).    POP     - . P               .
  
           .             ,   .          ,        ,    ().
                .      -      .         (UA),    ,         . ,    POP    ,        ().  ,       POP,   -   SMTP.         -    -  (POP)   (SMTP).         (split UA).        .
        : ,   .         ,   .        .    ,         .         (,   ),       (,   ). ,      .  .7    ,        .
------------
  POP  3 (  )
  
USER     
PASS     -
QUIT  TCP-
STAT           
LIST         (     )
RETR      (  - )
DELE     (   -  )
NOOP    ,     
LAST       ,     
RSET   ,    DELE
     ,       : + (,  - K)  -ERR (,   " " NAK).   ,            .  ,        .  RFC 1225      .      ,            .
------------
 
     TCP-     (  110),    USER      .     +,    PASS    :
CLIENT: USER kcope
SERVER: +
CLIENT: PASS secret
SERVER: + kcope's maildrop has 2 messages (320 octets)
  (   kcope  2  (320 ) ...)
     ,     .          .
 STAT        :
CLIENT: STAT
SERVER: + 2 320
 LIST ( )         :
CLIENT: LIST
SERVER: + 2 messages (320 octets)
SERVER: 1 120
SERVER: 2 200
SERVER: . ...
 LIST       :
CLIENT: LIST 2
SERVER: + 2 200 ...
CLIENT: LIST 3
SERVER: -ERR no such message, only 2 messages in maildrop
 TOP  ,        :
CLIENT: TOP 10
SERVER: +
SERVER: <the POP3 server sends the headers of the message,a blank line,
 and the first 10 lines of the message body>
 ( POP   ,     
    )
SERVER: . ...
CLIENT: TOP 100
SERVER: -ERR no such message
 NOOP     ,     .    ,          :
CLIENT: NOOP
SERVER: +
  ,   POP3  . ,  RETR            UA:
CLIENT: RETR 1 SERVER: +OK 120 octets SERVER: <the POPS server sends the entire message here> (-   ) SERVER: . . . . . .
 DELE  ,   :
CLIENT: DELE 1
SERVER: +OK message 1 deleted ... ( 1 )
CLIENT: DELE 2
SERVER: -ERR message 2 already deleted  2  )
 RSET        :
CLIENT: RSET
SERVER: +OK maildrop has 2 messages (320 octets)
 (   2  (320 ) )
   ,  QUIT    :
CLIENT: QUIT
SERVER: +OK dewey POP3 server signing off
CLIENT: QUIT
SERVER: +OK dewey POP3 server signing off (maildrop empty)
CLIENT: QUIT
SERVER: +OK dewey POP3 server signing off (2 messages left)
   ,             ,     QUIT     .            RSET,        .

//////////////////////////

: http://codenet.ru/webmast/pop3.php
  POP3

       POP3    110. 
       ,    TCP
     .   ,  
   .    POP3    
        .
    POP3    ,     
    .     CRLF ( Visual Basic
    vbCrLf).       
   ASCII .      
   .     3-  4- ,  
       40- .
     POP3       , 
       .  
    CRLF.     : "+OK" -
     "-ERR" - .
           .  
        CRLF,   
    ASCII  46 (".")   CRLF.
   POP3     .    
         ,  
      AUTHORIZATION ().    
       .   
       TRANSACTION ().    
       .  
     QUIT,     UPDATE.  
    POP3        .
     TCP  .
    POP3    INACTIVITY AUTOLOGOUT .  
    ,   ,   10 .  , 
           , 
            
   UPDATE.

       TCP   POP3 , 
    ,   CRLF, :
        S: +OK POP3 server ready
    POP3     AUTHORIZATION.  
      ,   USER  PASS.
       USER,    
      .    ,
        PASS,   
   .     USER  PASS  
   ,        
       QUIT.    
      maildrop ( ).    
   PASS         
      .     
   TRANSACTION.    :
: USER []
   : [] - ,    
   :    .
    :
     * +OK name is a valid mailbox
     * -ERR never heard of mailbox name
   :
        C: USER MonstrVB
        S: +OK MonstrVB is a real hoopy frood
        ...
        C: USER MonstrVB
        S: -ERR sorry, no mailbox for frated here
: PASS []
   : [] -    
   :     .
    :
     * +OK maildrop locked and ready
     * -ERR invalid password
     * -ERR unable to lock maildrop
   :
        C: USER MonstrVB
        S: +OK MonstrVB is a real hoopy frood
        C: PASS mymail
        S: +OK MonstrVB's maildrop has 2 messages (320 octets)
        ...
        C: USER MonstrVB
        S: +OK MonstrVB is a real hoopy frood
        C: PASS mymail
        S: -ERR maildrop already locked
: QUIT
   : 
   :   POP3      UPDATE.
    :
     * +OK
   :
        C: QUIT
        S: +OK dewey POP3 server signing off
  (Transaction)
         POP3 
      TRANSACTION,     
    .        .
        :
: STAT
   : 
   :         
   "+OK",          
      . ,     
      .
    :
     * +OK n s
   :
        C: STAT
        S: +OK 2 320
: LIST []
   : [] -   ( )
   :    ,     
    .     ,   
      ,    . ,
       .
    :
     * +OK scan listing follows
     * -ERR no such message
   :
        C: LIST
        S: +OK 2 messages (320 octets)
        S: 1 120
        S: 2 200
        S: .
        ...
        C: LIST 2
        S: +OK 2 200
        ...
        C: LIST 3
        S: -ERR no such message, only 2 messages in maildrop
:RETR []
   : [] -  
   :      
   .
    :
     * +OK message follows
     * -ERR no such message
   :
        C: RETR 1
        S: +OK 120 octets
        S:
        S: .
: DELE []
   : [] -  
   : POP3      , 
     ,       UPDATE.
    :
     * +OK message deleted
     * -ERR no such message
   :
        C: DELE 1
        S: +OK message 1 deleted
        ...
        C: DELE 2
        S: -ERR message 2 already deleted
: NOOP
   : 
   : POP3        .
    :
     * +OK
   :
        C: NOOP
        S: +OK
: RSET
   : 
   :   -      ,  
      .
    :
     * +OK
   :
        C: RSET
        S: +OK maildrop has 2 messages (320 octets)

       QUIT   TRANSACTION,  
      UPDATE.       ,
     .   TCP  .
 POP3 
            
   :
   : TOP [] [n]
   : [] -   [n] -  
   ( )
   :    ,     
        -     .
    :
        +OK top of message follows
        -ERR no such message
   :
           C: TOP 1 10 S: +OK
           S: < POP3   
                   10-    .>
           S: . ...
           C: TOP 100 3
           S: -ERR no such message
   : UIDL []
   : [] -   ( ).
   :     ,    
      .     , 
       ,   
   .
    :
        +OK unique-id listing follows
        -ERR no such message
   :
           C: UIDL S: +OK
           S: 1 whqtswO00WBw418f9t5JxYwZ
           S: 2 QhdPYR:00WBw1Ph7x7
           S: . ...
           C: UIDL 2
           S: +OK 2 QhdPYR:00WBw1Ph7x7 ...
           C: UIDL 3
           S: -ERR no such message, only 2 messages in maildrop

        POP3 :
        S: <  TCP  c POP3    110>
        S: +OK POP3 server ready
        C: USER MonstrVB
        S: +OK User MonstrVB is exists
        C: PASS mymail
        S: +OK MonsrVB's maildrop has 2 messages (320 octets)
        C: STAT
        S: +OK 2 320
        C: LIST
        S: +OK 2 messages (320 octets)
        S: 1 120
        S: 2 200
        S: .
        C: RETR 1
        S: +OK 120 octets
        S:
        S: .
        C: DELE 1
        S: +OK message 1 deleted
        C: RETR 2
        S: +OK 200 octets
        S:
        S: .
        C: DELE 2
        S: +OK message 2 deleted
        C: QUIT
        S: +OK dewey POP3 server signing off (maildrop empty)
        C: < >

//////////////////////////

  POP3  SMTP
    POP3 (Post Office Protocol version 3 -   )       .  110 ,       .   :
user []
  .      .
  e-mail YourOriginalName@Server.ru,     YourOriginalName.
pass [****]
   user.  ****  .
stat
           .
list
       .  
      "."
dele [x]
   x.       
 .
retr [x]
   x.         "."
loop
    ,      ,     
  .
quit
 .
      ,         (    ):
+OK POP3 sever ready
user ne_skagu
+OK send your password
pass ******
+OK
stat
+OK 3 93845
list
+OK
1 46394
2 20377
3 27074
.
dele 1
+OK message deleted
dele 2
+OK message deleted
dele 3
+OK message deleted
dele 4
-ERR message doesn't exists
quit
    SMTP (Simple Mail Transfer Protocol -   )       e-mail.  25 ,       .   :
MAIL FROM: [ ]
    .
RCPT TO: [ ]
   .
DATA
 ,       .  ,   ,         "."
QUIT
  .
      ,         (    ):
220 SMTP server ready
MAIL FROM: ne_skagu@server.ru
220 ok
RCPT TO: poluchatel@server.ru
220 ok
DATA
220 input your e-mail text
Date: Sat, 3 Nov 2001 16:14:46 +0300
From: otpravitel
To: poluchatel@server.ru
Subject: =?Windows-1251?B?z/Du9/Lo8uUg/fLuIQ==?=
MIME-Version: 1.0
Content-Type: text/plain; charset=Windows-1251
Content-Transfer-Encoding: 8bit
.
  .
.
220 message ok
QUIT
220 ok
             ,   .

