-í
ç¶<c       s§    d  Z    d k Z d k Z  d d g Z  d e f d „  ƒ  YZ  d Z  d Z  d Z  e e Z	   d f  d „  ƒ  YZ
 Ae d	 j oBd k Z Ce
 e i d
 ƒ Z De i ƒ  GHEe i e i d ƒ Fe i e i d ƒ Ge i ƒ  He i ƒ  \ Z Z Ixu e d
 e d
 ƒ DI]] Z Je i e ƒ \ Z Z Z Kd Ge Gd GHLx e DL] Z Md e GHqmWNd GHq.WOe i ƒ  n d S(   s@   A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
Ns   POP3s   error_protoc      s    t  Z  RS(   N(   s   __name__s
   __module__(    (    (    s   /usr/lib/python2.2/poplib.pys   error_proto s   	 in   s   s   
c      sC    t  Z d  Z H K e d „ Z b d „  Z i d „  Z r d „  Z „ d „  Z  d „  Z	 Ÿ d „  Z
 ¦ d „  Z ­ d	 „  Z ± d
 „  Z · d „  Z ¿ d „  Z É d „  Z Ö e d „ Z ä d „  Z ì d „  Z ô d „  Z ü d „  Z d „  Z d „  Z e i d ƒ Z d „  Z ,d „  Z 5e d „ Z RS(   sÏ  This class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    c 
   s_  K L | |  _  M | |  _ N d } O t |  _ P xÎ t i |  i  |  i d t i ƒ DP ]¨ } Q | \ } } } } }	 R y2 S t i | | | ƒ |  _ T |  i i |	 ƒ WnN U t i j
 o< } V |  i o W |  i i ƒ  n X t |  _ Y qU n XZ PqU W[ |  i o \ t i | ‚ n ] |  i i d ƒ |  _ ^ d |  _ _ |  i ƒ  |  _ d  S(   Ns!   getaddrinfo returns an empty listi    s   rb(   s   hosts   selfs   ports   msgs   Nones   socks   sockets   getaddrinfos   SOCK_STREAMs   ress   afs   socktypes   protos	   canonnames   sas   connects   errors   closes   makefiles   files
   _debuggings   _getresps   welcome(
   s   selfs   hosts   ports   afs	   canonnames   protos   msgs   ress   socktypes   sa(    (    s   /usr/lib/python2.2/poplib.pys   __init__K s*   	% 	c    sH   b c |  i d j o c d G| GHn d |  i i d | t f ƒ d  S(   Ni   s   *put*s   %s%s(   s   selfs
   _debuggings   lines   socks   sendalls   CRLF(   s   selfs   line(    (    s   /usr/lib/python2.2/poplib.pys   _putlineb s    c    s5   i j |  i o j d G| GHn k |  i | ƒ d  S(   Ns   *cmd*(   s   selfs
   _debuggings   lines   _putline(   s   selfs   line(    (    s   /usr/lib/python2.2/poplib.pys   _putcmdi s    c    sÐ   r s |  i i ƒ  } t |  i d j o t d G| GHn u | o u t d ƒ ‚ n v t | ƒ } z | d t j o { | d  | f Sn | | d t	 j o } | d d !| f Sn ~ | d  | f Sd  S(   Ni   s   *get*s   -ERR EOFiþÿÿÿi    iÿÿÿÿ(
   s   selfs   files   readlines   lines
   _debuggings   error_protos   lens   octetss   CRLFs   CR(   s   selfs   octetss   line(    (    s   /usr/lib/python2.2/poplib.pys   _getliner s     c    sw   „ … |  i ƒ  \ } } † |  i d j o † d G| GHn ‡ | d  } ˆ | d j o ‰ t | ƒ ‚ n Š | Sd  S(   Ni   s   *resp*s   +(   s   selfs   _getlines   resps   os
   _debuggings   cs   error_proto(   s   selfs   cs   resps   o(    (    s   /usr/lib/python2.2/poplib.pys   _getresp„ s    c    sÉ     |  i ƒ  } ‘ g  } d } ’ |  i ƒ  \ } } “ xy “ | d j oh ” | d  d j o • | d } – | d } n — | | } ˜ | i | ƒ ™ |  i ƒ  \ } } q< Wš | | | f Sd  S(   Ni    s   .i   s   ..i   (	   s   selfs   _getresps   resps   lists   octetss   _getlines   lines   os   append(   s   selfs   resps   octetss   lines   lists   o(    (    s   /usr/lib/python2.2/poplib.pys   _getlongresp s    c    s$   Ÿ   |  i | ƒ ¡ |  i ƒ  Sd  S(   N(   s   selfs   _putcmds   lines   _getresp(   s   selfs   line(    (    s   /usr/lib/python2.2/poplib.pys	   _shortcmdŸ s   c    s$   ¦ § |  i | ƒ ¨ |  i ƒ  Sd  S(   N(   s   selfs   _putcmds   lines   _getlongresp(   s   selfs   line(    (    s   /usr/lib/python2.2/poplib.pys   _longcmd¦ s   c    s   ­ ® |  i Sd  S(   N(   s   selfs   welcome(   s   self(    (    s   /usr/lib/python2.2/poplib.pys
   getwelcome­ s   c    s   ± ² | |  _ d  S(   N(   s   levels   selfs
   _debugging(   s   selfs   level(    (    s   /usr/lib/python2.2/poplib.pys   set_debuglevel± s   c    s   · » ¼ |  i d | ƒ Sd S(   sV   Send user name, return response

        (should indicate password required).
        s   USER %sN(   s   selfs	   _shortcmds   user(   s   selfs   user(    (    s   /usr/lib/python2.2/poplib.pys   user· s   c    s   ¿ Å Æ |  i d | ƒ Sd S(   s    Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        s   PASS %sN(   s   selfs	   _shortcmds   pswd(   s   selfs   pswd(    (    s   /usr/lib/python2.2/poplib.pys   pass_¿ s   c    s|   É Í Î |  i d ƒ } Ï | i ƒ  } Ð |  i o Ð d G| GHn Ñ t | d ƒ } Ò t | d ƒ } Ó | | f Sd S(   s]   Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        s   STATs   *stat*i   i   N(	   s   selfs	   _shortcmds   retvals   splits   retss
   _debuggings   ints   numMessagess   sizeMessages(   s   selfs   retss   sizeMessagess   retvals   numMessages(    (    s   /usr/lib/python2.2/poplib.pys   statÉ s    c    s<   Ö Þ ß | o à |  i d | ƒ Sn á |  i d ƒ Sd S(   s  Request listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...]].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        s   LIST %ss   LISTN(   s   whichs   selfs	   _shortcmds   _longcmd(   s   selfs   which(    (    s   /usr/lib/python2.2/poplib.pys   listÖ s   
c    s   ä è é |  i d | ƒ Sd S(   so   Retrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        s   RETR %sN(   s   selfs   _longcmds   which(   s   selfs   which(    (    s   /usr/lib/python2.2/poplib.pys   reträ s   c    s   ì ð ñ |  i d | ƒ Sd S(   sF   Delete message number 'which'.

        Result is 'response'.
        s   DELE %sN(   s   selfs	   _shortcmds   which(   s   selfs   which(    (    s   /usr/lib/python2.2/poplib.pys   deleì s   c    s   ô ø ù |  i d ƒ Sd S(   sX   Does nothing.

        One supposes the response indicates the server is alive.
        s   NOOPN(   s   selfs	   _shortcmd(   s   self(    (    s   /usr/lib/python2.2/poplib.pys   noopô s   c    s   ü ý þ |  i d ƒ Sd S(   s   Not sure what this does.s   RSETN(   s   selfs	   _shortcmd(   s   self(    (    s   /usr/lib/python2.2/poplib.pys   rsetü s   c    s}   y |  i d ƒ } Wn! t j
 o } | } n X|  i i ƒ  |  i i ƒ  	|  ` |  ` 
| Sd S(   sD   Signoff: commit changes on server, unlock mailbox, close connection.s   QUITN(   s   selfs	   _shortcmds   resps   error_protos   vals   files   closes   sock(   s   selfs   resps   val(    (    s   /usr/lib/python2.2/poplib.pys   quits   c    s   |  i d | ƒ Sd S(   s   Not sure what this does.s   RPOP %sN(   s   selfs	   _shortcmds   user(   s   selfs   user(    (    s   /usr/lib/python2.2/poplib.pys   rpops   s   \+OK.*(<[^>]+>)c    s©   "#|  i i |  i ƒ } $| o %t d ƒ ‚ n &d k } '| i | i d ƒ | ƒ i
 ƒ  } (d i t d „  | ƒ ƒ } )|  i d | | f ƒ Sd S(   s   Authorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user    - mailbox user;
                secret  - secret shared between client and server.

        NB: mailbox is locked by server from here to 'quit()'
        s!   -ERR APOP not supported by serverNi   s    c    s   (d t  |  ƒ S(   Ns   %02x(   s   ords   x(   s   x(    (    s   /usr/lib/python2.2/poplib.pys   <lambda>(s    s
   APOP %s %s(   s   selfs	   timestamps   matchs   welcomes   ms   error_protos   md5s   news   groups   secrets   digests   joins   maps	   _shortcmds   user(   s   selfs   users   secrets   ms   digests   md5(    (    s   /usr/lib/python2.2/poplib.pys   apops   
%c    s$   ,12|  i d | | f ƒ Sd S(   s­   Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        s	   TOP %s %sN(   s   selfs   _longcmds   whichs   howmuch(   s   selfs   whichs   howmuch(    (    s   /usr/lib/python2.2/poplib.pys   top,s   c    s<   5;<| o =|  i d | ƒ Sn >|  i d ƒ Sd S(   sì   Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        s   UIDL %ss   UIDLN(   s   whichs   selfs	   _shortcmds   _longcmd(   s   selfs   which(    (    s   /usr/lib/python2.2/poplib.pys   uidl5s   
(   s   __name__s
   __module__s   __doc__s	   POP3_PORTs   __init__s   _putlines   _putcmds   _getlines   _getresps   _getlongresps	   _shortcmds   _longcmds
   getwelcomes   set_debuglevels   users   pass_s   stats   Nones   lists   retrs   deles   noops   rsets   quits   rpops   res   compiles	   timestamps   apops   tops   uidl(    (    (    s   /usr/lib/python2.2/poplib.pys   POP3  s2   (	
	s   __main__i   i   i   s   Message s   :s      s   -----------------------(   s   __doc__s   res   sockets   __all__s	   Exceptions   error_protos	   POP3_PORTs   CRs   LFs   CRLFs   POP3s   __name__s   syss   argvs   as
   getwelcomes   users   pass_s   lists   stats   numMsgss	   totalSizes   ranges   is   retrs   headers   msgs   octetss   lines   quit(   s   LFs   syss   sockets   error_protos	   POP3_PORTs	   totalSizes   is   headers   octetss   POP3s   res   CRLFs   as   msgs   CRs   lines   numMsgss   __all__(    (    s   /usr/lib/python2.2/poplib.pys   ? s4   			ÿ " 	
 	