Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.135.224.236
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : poplib.cpython-310.pyc
o

^b^;�@shdZddlZddlZddlZddlZzddlZdZWney%dZYnwddgZGdd�de	�Z
dZd	Zd
Z
dZe
eZdZGd
d�d�ZerVGdd�de�Ze�d�edkr�ddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]Z e�!e �\Z"Z#Z$ede �e#D]Z%ede%�q�ed�q�e�&�dSdS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�//usr/local/python-3.10/lib/python3.10/poplib.pyrs�ni��
�
ic@seZdZdZdZeejfdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd=d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Ze�d0�Z d1d2�Z!d3d4�Z"d=d5d6�Z#d7d8�Z$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|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCs(|dur
|s
td��t�|j|jf|�S)Nz0Non-blocking socket (timeout=0) is not supported)�
ValueError�socket�create_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrr�sendall�CRLF�r�linerrr�_putlinersz
POP3._putlinecCs.|jr
tdt|��t||j�}|�|�dS)Nz*cmd*)rr r!�bytes�encodingr&r$rrr�_putcmdzszPOP3._putcmdcCs�|j�td�}t|�tkrtd��|jdkrtdt|��|s$td��t|�}|dd�tkr8|dd�|fS|dd�t	krH|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrr r!r#�CR)rr%�octetsrrr�_getline�sz
POP3._getlinecCs:|��\}}|jdkrtdt|��|�d�st|��|S)Nrz*resp*�+)r1rr r!�
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsr|��}g}d}|��\}}|dkr4|�d�r!|d}|dd�}||}|�|�|��\}}|dks|||fS)Nr�.s..r)rr1r3�append)rr4�listr0r%r5rrr�_getlongresp�s

�
zPOP3._getlongrespcC�|�|�|��S�N)r)rr$rrr�	_shortcmd��
zPOP3._shortcmdcCr:r;)r)r9r$rrr�_longcmd�r=z
POP3._longcmdcCs|jSr;)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr;)r)r�levelrrr�set_debuglevel�s
zPOP3.set_debuglevelcC�|�d|�S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�r<�r�userrrrrF��z	POP3.usercCrC)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %srD)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jrtdt|��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sizeMessagesrrr�stat�s
z	POP3.statNcC� |dur|�d|�S|�d�S)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 %s�LIST�r<r>�r�whichrrrr8�s	
z	POP3.listcCrC)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�r>rPrrr�retr�rGz	POP3.retrcCrC)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %srDrPrrr�delerGz	POP3.delecC�
|�d�S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPrDr?rrr�noops
z	POP3.noopcCrU)z(Unmark all messages marked for deletion.ZRSETrDr?rrr�rsets
z	POP3.rsetcCs|�d�}|��|S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r<�close)rr4rrr�quits
z	POP3.quitcCsBzY|j}d|_|dur|��W|j}d|_|durXz8z|�tj�Wn!tyD}z|jtjkr:t	|dd�dkr:�WYd}~nd}~wwW|��dSW|��dS|��wdS|j}d|_|dur�z6z|�tj�Wn!ty�}z|jtjkr�t	|dd�dkr��WYd}~nd}~wwW|��wW|��w|��ww)z8Close the connection without assuming anything about it.N�winerrorri&')
rrXr�shutdownr�	SHUT_RDWR�OSError�errnoZENOTCONN�getattr)rrr�excrrrrXsP�����	�������
	��z
POP3.closecCrC)zNot sure what this does.zRPOP %srDrErrr�rpop7sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|std��ddl}|�d�|}|�|��	�}|�
d||f�S)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(�	timestamp�matchrr�hashlib�group�md5�	hexdigestr<)rrF�passwordZsecret�mrd�digestrrr�apop>sz	POP3.apopcCs|�d||f�S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srR)rrQZhowmuchrrr�topSszPOP3.topcCrM)z�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]
        NzUIDL %sZUIDLrOrPrrr�uidl\s
z	POP3.uidlcCrU)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8rDr?rrr�utf8hs
z	POP3.utf8cCsZdd�}i}z|�d�}|d}|D]}||�\}}|||<qW|Sty,td��w)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|dd�fS)N�asciirr)�decoderJ)r%Zlstrrr�	_parsecap{szPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r>r)rrq�capsr4ZrawcapsZcaplineZcapnmZcapargsrrr�capans


���z	POP3.capacCsxtstd��|jr
td��|��}d|vrtd��|dur!t��}|�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 serverN�Zserver_hostnamerT)�HAVE_SSLrrrs�ssl�_create_stdlib_contextr<�wrap_socketrr
rr)r�contextrrr4rrr�stls�s 
�z	POP3.stlsr;)'rrr�__doc__r(�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr&r)r1rr9r<r>r@rBrFrHrLr8rSrTrVrWrYrXra�re�compilerbrkrlrmrnrsr{rrrrr3sD+
�






	c@s8eZdZdZeddejdfdd�Zdd�Zd	dd�Z	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�|dur|durtd��|dur|durtd��|dus |dur+ddl}|�dtd�||_||_|dur<tj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrI)�certfile�keyfile)r�warnings�warn�DeprecationWarningr�r�rwrxrzrr)rr
rr�r�rrzr�rrrr�s"��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nru)rrrzryr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rt)r)rr�r�rzrrrr{�sz
POP3_SSL.stls)NNN)
rrrr|�
POP3_SSL_PORTrr~rrr{rrrrr��s
�r��__main__rrI�zMessage %d:z   z-----------------------)'r|r^rrrrwrv�ImportError�__all__�	Exceptionrr}r�r/ZLFr#r-rr�r7r�argv�ar r@rFrHr8rLZnumMsgsZ	totalSize�range�irS�header�msgr0r%rYrrrr�<module>sR�p
0
�
© 2025 GrazzMean