%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/__pycache__/poplib.cpython-38.pyc

U

na:@sldZddlZddlZddlZddlZzddlZdZWnek
rLdZYnXddgZGddde	Z
dZd	Zd
Z
dZe
eZdZGd
ddZerGdddeZededkrhddlZeejdZeeeejdeejdee\ZZededD]BZ e!e \Z"Z#Z$ede e#D]Z%ede%q@edqe&dS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
NTFPOP3error_protoc@seZdZdS)rN)__name__
__module____qualname__rr"/usr/local/lib/python3.8/poplib.pyrsni

ic@seZdZdZdZeejfddZddZ	ddZ
d	d
ZddZd
dZ
ddZddZddZddZddZddZddZddZd=d d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zed0Z d1d2Z!d3d4Z"d>d5d6Z#d7d8Z$d9d:Z%d?d;d<Z&dS)@raPThis 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)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    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.
    zUTF-8cCsP||_||_d|_td||||||_|jd|_d|_	|
|_dS)NFzpoplib.connectrbr)hostport_tls_establishedsysaudit_create_socketsockmakefilefile
_debugging_getrespwelcome)selfr
rtimeoutrrr__init__bsz
POP3.__init__cCst|j|jf|SN)socketcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|td|||j|tdS)Nz*put*zpoplib.putline)rprintreprrrrsendallCRLFrlinerrr_putlineps
z
POP3._putlinecCs.|jrtdt|t||j}||dS)Nz*cmd*)rr r!bytesencodingr&r$rrr_putcmdxszPOP3._putcmdcCs|jtd}t|tkr$td|jdkr<tdt||sHtdt|}|ddtkrp|dd|fS|ddt	kr|dd|fS|dd|fS)Nrz
line too longz*get*z-ERR EOF)
rreadline_MAXLINElenrrr r!r#CR)rr%octetsrrr_getlines
z
POP3._getlinecCs:|\}}|jdkr$tdt||ds6t||S)Nrz*resp*+)r1rr r!
startswithr)rresporrrrs

z
POP3._getrespcCsl|}g}d}|\}}|dkrb|drB|d}|dd}||}|||\}}q|||fS)Nr.s..r)rr1r3append)rr4listr0r%r5rrr_getlongresps

zPOP3._getlongrespcCs|||Sr)r)rr$rrr	_shortcmds
zPOP3._shortcmdcCs|||Sr)r)r9r$rrr_longcmds
z
POP3._longcmdcCs|jSr)rrrrr
getwelcomeszPOP3.getwelcomecCs
||_dSr)r)rlevelrrrset_debuglevelszPOP3.set_debuglevelcCs|d|S)zVSend user name, return response

        (should indicate password required).
        zUSER %sr:ruserrrrrBsz	POP3.usercCs|d|S)zSend password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %sr@)rZpswdrrrpass_sz
POP3.pass_cCsF|d}|}|jr&tdt|t|d}t|d}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        ZSTATz*stat*r)r:splitrr r!int)rZretvalZretsZnumMessagesZsizeMessagesrrrstats
z	POP3.statNcCs |dk	r|d|S|dS)aRequest listing, return result.

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

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        NzLIST %sLISTr:r;rwhichrrrr8s	z	POP3.listcCs|d|S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %sr;rJrrrretrsz	POP3.retrcCs|d|S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %sr@rJrrrdelesz	POP3.delecCs
|dS)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPr@r<rrrnoopsz	POP3.noopcCs
|dS)z(Unmark all messages marked for deletion.ZRSETr@r<rrrrsetsz	POP3.rsetcCs|d}||S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r:close)rr4rrrquits
z	POP3.quitcCsz |j	}d|_	|dk	r|W5|j}d|_|dk	rzVz|tjWn@tk
r}z"|jtjkrxt|dddkrxW5d}~XYnXW5|XXdS)z8Close the connection without assuming anything about it.Nwinerrorri&')
rrQshutdownr	SHUT_RDWROSErrorerrnoZENOTCONNgetattrr)rrexcrrrrrQs z
POP3.closecCs|d|S)zNot sure what this does.zRPOP %sr@rArrrrpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j}|j|j}|s&tdddl}|d|}||	}|
d||fS)aAuthorisation

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

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        z!-ERR APOP not supported by serverrNrz
APOP %s %s)r'r(	timestampmatchrrhashlibgroupmd5	hexdigestr:)rrBZpasswordZsecretmr]digestrrrapop<sz	POP3.apopcCs|d||fS)zRetrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srL)rrKZhowmuchrrrtopQszPOP3.topcCs |dk	r|d|S|dS)zReturn 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]
        NzUIDL %sZUIDLrIrJrrruidlZsz	POP3.uidlcCs
|dS)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8r@r<rrrutf8fsz	POP3.utf8c	
Cspdd}i}z4|d}|d}|D]}||\}}|||<q$Wn*tk
rj}ztdW5d}~XYnX|S)aReturn server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        cSs"|d}|d|ddfS)Nasciirr)decoderE)r%Zlstrrr	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by serverN)r;r)	rricapsr4ZrawcapsZcaplineZcapnmZcapargsZ_errrrrcapals

z	POP3.capacCsxtstd|jrtd|}d|kr2td|dkrBt}|d}|j|j|j	d|_|j
d|_d|_|S)	z{Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        z-ERR TLS support missing$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverNZserver_hostnamerT)HAVE_SSLrrrkssl_create_stdlib_contextr:wrap_socketrr
rr)rcontextrjr4rrrstlss 
z	POP3.stls)N)N)N)'rrr__doc__r(	POP3_PORTr_GLOBAL_DEFAULT_TIMEOUTrrr&r)r1rr9r:r;r=r?rBrCrGr8rMrNrOrPrRrQrZrecompiler[rcrdrerfrkrsrrrrr3sB+





	
c@s8eZdZdZeddejdfddZddZd	ddZ	dS)
POP3_SSLaPOP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        NcCs|dk	r|dk	rtd|dk	r0|dk	r0td|dk	s@|dk	rVddl}|dtd||_||_|dkrxtj||d}||_t	
||||dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrD)certfilekeyfile)
ValueErrorwarningswarnDeprecationWarningr{rzrorprrrr)rr
rr{rzrrrr}rrrrs$zPOP3_SSL.__init__cCs"t||}|jj||jd}|S)Nrm)rrrrrqr
)rrrrrrrs
zPOP3_SSL._create_socketcCstddS)zThe method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rlN)r)rr{rzrrrrrrssz
POP3_SSL.stls)NNN)
rrrrt
POP3_SSL_PORTrrvrrrsrrrrrys
ry__main__rrDzMessage %d:z   z-----------------------)'rtrWrwrrrornImportError__all__	Exceptionrrurr/ZLFr#r-rryr7rargvar r=rBrCr8rGZnumMsgsZ	totalSizerangeirMheadermsgr0r%rRrrrr<module>sL
n0



Zerion Mini Shell 1.0