%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/poplib.cpython-311.pyc

�

c��f^;��&�dZddlZddlZddlZddlZ	ddlZdZn
#e$rdZYnwxYwddgZGd�de	��Z
dZd	Zd
Z
dZe
ezZdZGd
�d��Zer#Gd�de��Ze�d��edk�rddlZeejd��Zee�����e�ejd��e�ejd��e���e���\ZZededz��D]GZ e�!e ��\Z"Z#Z$ede z��e#D]Z%ede%z���ed���He�&��dSdS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc��eZdZdS)rN)�__name__�
__module__�__qualname__���-/opt/alt/python311/lib64/python3.11/poplib.pyrrs�������r
�ni��
�
ic���eZdZdZdZeejfd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd!d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejd��Z d�Z!d�Z"d!d�Z#d�Z$d�Z%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-8c��||_||_d|_tjd|||��|�|��|_|j�d��|_d|_	|�
��|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfrr�timeouts    r�__init__z
POP3.__init__bsu����	���	� %����	�"�D�$��5�5�5��'�'��0�0��	��I�&�&�t�,�,��	�����}�}������r
c�j�|�|std���tj|j|jf|��S)Nz0Non-blocking socket (timeout=0) is not supported)�
ValueError�socket�create_connectionrr)rrs  rrzPOP3._create_socketms8����w���O�P�P�P��'���D�I�(>��H�H�Hr
c���|jdkrtdt|����tjd||��|j�|tz��dS)N�z*put*zpoplib.putline)r�print�reprrrr�sendall�CRLF�r�lines  r�_putlinez
POP3._putlinersY���?�Q����g�t�D�z�z� :� :� :��	�"�D�$�/�/�/��	���$��+�&�&�&�&�&r
c��|jrtdt|����t||j��}|�|��dS)Nz*cmd*)rr'r(�bytes�encodingr-r+s  r�_putcmdzPOP3._putcmdzsH���?�6�E�'�4��:�:�6�6�6��T�4�=�)�)���
�
�d�����r
c��|j�tdz��}t|��tkrt	d���|jdkrt
dt|����|st	d���t|��}|dd�tkr|dd�|fS|dd�tkr|dd�|fS|dd�|fS)Nr&z
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrr'r(r*�CR)rr,�octetss   r�_getlinez
POP3._getline�s����y�!�!�(�Q�,�/�/���t�9�9�x����o�.�.�.��?�Q����g�t�D�z�z� :� :� :��2�;�z�2�2�2��T��������9��������9�f�$�$�����8�r�>�>���"��:�v�%�%��C�R�C�y�&� � r
c���|���\}}|jdkrtdt|����|�d��st|���|S)Nr&z*resp*�+)r:rr'r(�
startswithr)r�resp�os   rrz
POP3._getresp�s\���-�-�/�/���a��?�Q����h��T�
�
� ;� ;� ;����t�$�$�	$��d�#�#�#��r
c�,�|���}g}d}|���\}}|dkr[|�d��r|dz
}|dd�}||z}|�|��|���\}}|dk�[|||fS)Nr�.s..r&)rr:r=�append)rr>�listr9r,r?s      r�_getlongrespzPOP3._getlongresp�s����}�}������A�6��-�-�/�/���a��d�l�l����u�%�%�
 ��a�C���A�B�B�x���a�Z�F��K�K������m�m�o�o�G�D�!�
�d�l�l��T�6�!�!r
c�T�|�|��|���S�N)r1rr+s  r�	_shortcmdzPOP3._shortcmd�s"�����T�����}�}���r
c�T�|�|��|���SrF)r1rDr+s  r�_longcmdz
POP3._longcmd�s&�����T����� � �"�"�"r
c��|jSrF)r�rs r�
getwelcomezPOP3.getwelcome�s
���|�r
c��||_dSrF)r)r�levels  r�set_debuglevelzPOP3.set_debuglevel�s
������r
c�2�|�d|z��S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�rG�r�users  rrSz	POP3.user�s��
�~�~�i�$�.�/�/�/r
c�2�|�d|z��S)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %srQ)r�pswds  r�pass_z
POP3.pass_�s���~�~�i�$�.�/�/�/r
c��|�d��}|���}|jrtdt	|����t|d��}t|d��}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        �STATz*stat*r&�)rG�splitrr'r(�int)r�retval�rets�numMessages�sizeMessagess     r�statz	POP3.stat�sh��
����'�'���|�|�~�~���?�7�E�(�D��J�J�7�7�7��$�q�'�l�l���4��7�|�|���\�*�*r
Nc�`�|�|�d|z��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�rGrI�r�whichs  rrCz	POP3.list�s3�����>�>�)�e�"3�4�4�4��}�}�V�$�$�$r
c�2�|�d|z��S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�rIrds  r�retrz	POP3.retr�s��
�}�}�Y��.�/�/�/r
c�2�|�d|z��S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %srQrds  r�delez	POP3.deles��
�~�~�i�%�/�0�0�0r
c�,�|�d��S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        �NOOPrQrKs r�noopz	POP3.noops��
�~�~�f�%�%�%r
c�,�|�d��S)z(Unmark all messages marked for deletion.�RSETrQrKs r�rsetz	POP3.rsets���~�~�f�%�%�%r
c�X�|�d��}|���|S)zDSignoff: commit changes on server, unlock mailbox, close connection.�QUIT)rG�close)rr>s  r�quitz	POP3.quits%���~�~�f�%�%���
�
�����r
c���	|j}d|_|�|���|j}d|_|��	|�tj��nB#t$r5}|jtjkrt|dd��dkr�Yd}~nd}~wwxYw|���dS#|���wxYwdS#|j}d|_|��	|�tj��nB#t$r5}|jtjkrt|dd��dkr�Yd}~nd}~wwxYw|���w#|���wxYwwxYw)z8Close the connection without assuming anything about it.N�winerrorri&')
rrsr�shutdownr#�	SHUT_RDWR�OSError�errno�ENOTCONN�getattr)rrr�excs    rrsz
POP3.closes���	!��9�D��D�I����
�
�����9�D��D�I���
!��M�M�&�"2�3�3�3�3�������	�U�^�3�3�"�3�
�A�6�6�%�?�?�����������
�����J�J�L�L�L�L�L��D�J�J�L�L�L�L���� ����9�D��D�I���
!��M�M�&�"2�3�3�3�3�������	�U�^�3�3�"�3�
�A�6�6�%�?�?�����������
�����J�J�L�L�L�L��D�J�J�L�L�L�L���� ���sv�$C
�A�B/�
B�!+B�B/�B�B/�/C�
E-�C<�;E�<
D;�+D6�1E�6D;�;E�>E-�E)�)E-c�2�|�d|z��S)zNot sure what this does.zRPOP %srQrRs  r�rpopz	POP3.rpop7s���~�~�i�$�.�/�/�/r
s\+OK.[^<]*(<.*>)c�H�t||j��}|j�|j��}|std���ddl}|�d��|z}|�|���	��}|�
d|�d|����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 serverrNr&zAPOP � )r/r0�	timestamp�matchrr�hashlib�group�md5�	hexdigestrG)rrS�password�secret�mr��digests       r�apopz	POP3.apop>s����x���/�/���N� � ���.�.���	C��A�B�B�B�����������F�"�����V�$�$�.�.�0�0���~�~�~�d�d�d�F�F�;�<�<�<r
c�8�|�d|�d|����S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        zTOP r�rg)rre�howmuchs   r�topzPOP3.topSs#���}�}�}�E�E�E�7�7�;�<�<�<r
c�`�|�|�d|z��S|�d��S)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 %s�UIDLrcrds  r�uidlz	POP3.uidl\s3�����>�>�)�e�"3�4�4�4��}�}�V�$�$�$r
c�,�|�d��S)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        �UTF8rQrKs r�utf8z	POP3.utf8hs���~�~�f�%�%�%r
c��d�}i}	|�d��}|d}|D]}||��\}}|||<�n#t$rtd���wxYw|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...
        c�t�|�d�����}|d|dd�fS)N�asciirr&)�decoderZ)r,�lsts  r�	_parsecapzPOP3.capa.<locals>._parsecap{s5���+�+�g�&�&�,�,�.�.�C��q�6�3�q�r�r�7�?�"r
�CAPAr&z!-ERR CAPA not supported by server)rIr)rr��capsr>�rawcaps�capline�capnm�capargss        r�capaz	POP3.capans���	#�	#�	#���	C��=�=��(�(�D��1�g�G�"�
&�
&��!*��7�!3�!3���w�%��U���
&���	C�	C�	C��A�B�B�B�	C�����s	�5=�Ac��tstd���|jrtd���|���}d|vrtd���|�t	j��}|�d��}|�|j|j	���|_|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 established�STLSz!-ERR STLS not supported by serverN��server_hostnamerT)�HAVE_SSLrrr��ssl�_create_stdlib_contextrG�wrap_socketrrrr)r�contextr�r>s    r�stlsz	POP3.stls�s���
�	:��8�9�9�9�� �	F��D�E�E�E��y�y�{�{����~�~��A�B�B�B��?��0�2�2�G��~�~�f�%�%���'�'��	�8<�	�(�C�C��	��I�&�&�t�,�,��	� $����r
rF)'rrr�__doc__r0�	POP3_PORTr#�_GLOBAL_DEFAULT_TIMEOUTr rr-r1r:rrDrGrIrLrOrSrVr`rCrhrjrmrprtrsr�re�compiler�r�r�r�r�r�r�r	r
rrr3s�������)�)�V�H�"+��7�	'�	'�	'�	'�I�I�I�
'�'�'����!�!�!�*���"�"�"� ���#�#�#���� � � �0�0�0�0�0�0�
+�
+�
+�%�%�%�%�0�0�0�1�1�1�&�&�&�&�&�&�
���!�!�!�80�0�0�
��
�/�0�0�I�=�=�=�*=�=�=�	%�	%�	%�	%�&�&�&����:�����r
c�<�eZdZdZeddejdfd�Zd�Zdd�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.
        Nc�.�|�|�td���|�|�td���|�|� ddl}|�dtd��||_||_|�t
j||���}||_t�
||||��dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrY)�certfile�keyfile)r"�warnings�warn�DeprecationWarningr�r�r�r�r�rr )rrrr�r�rr�r�s        rr zPOP3_SSL.__init__�s����"�w�':� �"-�.�.�.��"�x�';� �"-�.�.�.��"�h�&:������
�
�7�8J�A�O�O�O�"�D�L�$�D�M����4�h�=D�F�F�F��"�D�L��M�M�$��d�G�4�4�4�4�4r
c�~�t�||��}|j�||j���}|S)Nr�)rrr�r�r)rrrs   rrzPOP3_SSL._create_socket�sA���&�&�t�W�5�5�D��<�+�+�D�<@�I�,�G�G�D��Kr
c� �td���)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            r�)r)rr�r�r�s    rr�z
POP3_SSL.stls�s��
�D�E�E�Er
)NNN)
rrrr��
POP3_SSL_PORTr#r�r rr�r	r
rr�r��sl������	�	�'4�T�D�#�;�T�	5�	5�	5�	5�(	�	�	�	F�	F�	F�	F�	F�	Fr
r��__main__r&rY�zMessage %d:z   z-----------------------)'r�rzr�r#rr�r��ImportError�__all__�	Exceptionrr�r�r8�LFr*r6rr�rBr�argv�ar'rLrSrVrCr`�numMsgs�	totalSize�range�irh�header�msgr9r,rtr	r
r�<module>r�so����
����	�	�	�	�
�
�
�
�
�
�
�
���J�J�J��H�H�������H�H�H������-�
 ��#�"�"�"�"�)�"�"�"�
�	��
���
��	�"�u����k�k�k�k�k�k�k�k�\�2�.F�.F�.F�.F�.F�4�.F�.F�.F�`�N�N�:�����z����J�J�J���S�X�a�[���A�	�E�!�,�,�.�.�����F�F�3�8�A�;�����G�G�C�H�Q�K�����F�F�H�H�H��6�6�8�8��W�i�
�U�1�g��k�
"�
"�)�)�� !���q�	�	����f�
��m�a�� � � ��	 �	 �D��E�%�$�,�����
��'�(�(�(�(��F�F�H�H�H�H�H��s��%�%

Zerion Mini Shell 1.0