����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
python312
/
lib64
/
python3.12
/
__pycache__
/
Filename :
poplib.cpython-312.opt-1.pyc
back
Copy
� ����4[Yh9���������������������������d�Z�ddlZddlZddlZddlZ �ddlZdZddgZ�G�d��de �������Z dZd Zd Z dZe ez���ZdZ�G�d ��d�������Zer�G�d��de�������Zej'������������������d��������edk(��r�ddlZ�eej*������������������d����������Z�eej1����������������������������������ej3������������������ej*������������������d�����������ej5������������������ej*������������������d�����������ej7���������������������������ej9��������������������������\��ZZ�ededz����������D�]<��Z ejC������������������e �������\��Z"Z#Z$�ede z����������e#D�] ��Z%�ede%z��������������ed���������>�ejM���������������������������yy#�e$�r�dZY���@w�xY�w)z@A POP3 client class. Based on the J. Myers POP3 draft, Jan. 96 �����NTF�POP3�error_protoc�������������������������e�Zd�Zy)r���N)�__name__� __module__�__qualname__��������-/opt/alt/python312/lib64/python3.12/poplib.pyr���r������s�����r ����n���i������� ���� i���c�������������������������e�Zd�ZdZdZeej������������������fd�Zd��Z d��Z d��Zd��Zd��Z d ��Zd ��Zd��Zd��Zd ��Zd��Zd��Zd��Zd!d�Zd��Zd��Zd��Zd��Zd��Zd��Zd��Z�ej>������������������d�������Z d��Z!d��Z"d!d�Z#d��Z$d��Z%d!d �Z&y)"r���aP��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) 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|�_��������t��������j������������������d|�||��������|�j������������������|�������|�_��������|�j������������������j������������������d�������|�_��������d|�_ ��������|�j��������������������������|�_��������y�)NFzpoplib.connect�rbr���)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file� _debugging�_getresp�welcome)�selfr���r����timeouts��� r����__init__z POP3.__init__b���sg�������� ��� � %���� � �"�D�$��5��'�'��0�� ��I�I�&�&�t�,�� �����}�}���r ���c������������������x�����|� |st��������d��������t��������j������������������|�j������������������|�j������������������f|�������S�)Nz0Non-blocking socket (timeout=0) is not supported)� ValueError�socket�create_connectionr���r���)r���r���s��� r���r���zPOP3._create_socketm���s6��������w��O�P�P��'�'����D�I�I�(>��H�Hr ���c�����������������������|�j�������������������dkD��rt��������dt��������|���������������t��������j������������������d|�|��������|�j ������������������j ������������������|t��������z�����������y�)N����z*put*zpoplib.putline)r����print�reprr���r���r����sendall�CRLF�r����lines��� r����_putlinez POP3._putliner���sB�������?�?�Q���g�t�D�z� :�� � �"�D�$�/�� � ���$��+�&r ���c�����������������������|�j�������������������rt��������dt��������|���������������t��������||�j�������������������������}|�j������������������|��������y�)Nz*cmd*)r���r'���r(����bytes�encodingr-���r+���s��� r����_putcmdzPOP3._putcmdz���s2�������?�?�E�'�4��:�6��T�4�=�=�)��� � �d�r ���c������������������R����|�j�������������������j������������������t��������dz����������}t��������|�������t��������kD��rt ��������d��������|�j ������������������dkD��rt ��������dt��������|���������������|st ��������d��������t��������|�������}|dd��t��������k(��r|d�d�|fS�|d�d�t��������k(��r|dd�|fS�|d�d�|fS�)Nr&���z line too longz*get*z-ERR EOF������) r����readline�_MAXLINE�lenr���r���r'���r(���r*����CR)r���r,����octetss��� r����_getlinez POP3._getline����s��������y�y�!�!�(�Q�,�/���t�9�x���o�.�.��?�?�Q���g�t�D�z� :��;�z�2�2��T�������9������9�f�$�$����8�r�>���"�:�v�%�%��C�R�y�&� � r ���c�����������������������|�j��������������������������\��}}|�j������������������dkD��rt��������dt��������|���������������|j ������������������d�������st��������|��������|S�)Nr&���z*resp*����+)r:���r���r'���r(���� startswithr���)r����resp�os��� r���r���z POP3._getresp����sF�������-�-�/���a��?�?�Q���h��T� � ;����t�$��d�#�#��r ���c�����������������������|�j��������������������������}g�}d}|�j��������������������������\��}}|dk7��rJ|j������������������d�������r |dz ��}|dd��}||z���}|j������������������|��������|�j��������������������������\��}}|dk7��r�J|||fS�)Nr�������.s���..r&���)r���r:���r=����append)r���r>����listr9���r,���r?���s��� r����_getlongrespzPOP3._getlongresp����s��������}�}�����A�6��-�-�/���a��d�l����u�%��a�C���A�B�x���a�Z�F��K�K����m�m�o�G�D�!� ��d�l���T�6�!�!r ���c������������������D�����|�j������������������|��������|�j��������������������������S��N)r1���r���r+���s��� r���� _shortcmdzPOP3._shortcmd����s���������T���}�}��r ���c������������������D�����|�j������������������|��������|�j��������������������������S�rF���)r1���rD���r+���s��� r����_longcmdz POP3._longcmd����s���������T��� � �"�"r ���c�����������������������|�j�������������������S�rF���)r����r���s��� r���� getwelcomezPOP3.getwelcome����s�������|�|�r ���c�����������������������||�_���������y�rF���)r���)r����levels��� r����set_debuglevelzPOP3.set_debuglevel����s ��������r ���c������������������*�����|�j������������������d|z���������S�)zVSend user name, return response (should indicate password required). zUSER %s�rG����r����users��� r���rS���z POP3.user����s������ ��~�~�i�$�.�/�/r ���c������������������*�����|�j������������������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������������������*����|�j������������������d�������}|j��������������������������}|�j������������������rt��������dt ��������|���������������t��������|�������dk��rt ��������d�������� �t��������|d����������}t��������|d����������}||fS�#�t��������$�r�t ��������d��������w�xY�w)z]Get mailbox status. Result is tuple of 2 ints (message count, mailbox size) �STATz*stat*����zInvalid STAT response formatr&�������z.Invalid STAT response data: non-numeric values) rG����splitr���r'���r(���r7���r����intr"���)r����retval�rets�numMessages�sizeMessagess��� r����statz POP3.stat����s������� �����'���|�|�~���?�?�E�(�D��J�7� ��t�9�q�=��<�=�=� P��d�1�g�,�K��t�A�w�<�L���\�*�*����� P��N�O�O� P�s����A=��=BNc������������������P�����|�|�j������������������d|z���������S�|�j������������������d�������S�)a��Request 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. zLIST %s�LIST�rG���rI����r����whichs��� r���rC���z POP3.list����s-����������>�>�)�e�"3�4�4��}�}�V�$�$r ���c������������������*�����|�j������������������d|z���������S�)zoRetrieve whole message number 'which'. Result is in form ['response', ['line', ...], octets]. zRETR %s�rI���re���s��� r����retrz POP3.retr��s������ ��}�}�Y��.�/�/r ���c������������������*�����|�j������������������d|z���������S�)zFDelete message number 'which'. Result is 'response'. zDELE %srQ���re���s��� r����delez POP3.dele��s������ ��~�~�i�%�/�0�0r ���c������������������$�����|�j������������������d�������S�)zXDoes nothing. One supposes the response indicates the server is alive. �NOOPrQ���rK���s��� r����noopz POP3.noop��s������ ��~�~�f�%�%r ���c������������������$�����|�j������������������d�������S�)z(Unmark all messages marked for deletion.�RSETrQ���rK���s��� r����rsetz POP3.rset��s�������~�~�f�%�%r ���c������������������H�����|�j������������������d�������}|�j���������������������������|S�)zDSignoff: commit changes on server, unlock mailbox, close connection.�QUIT)rG����close)r���r>���s��� r����quitz POP3.quit ��s�������~�~�f�%��� � ���r ���c����������������������� �|�j�������������������}d|�_���������|�|j���������������������������|�j������������������}d|�_��������|�1 �|j������������������t��������j ��������������������������|j���������������������������yy#�t��������$�r8}|j������������������t��������j������������������k7��rt��������|dd�������dk7��r��Y�d}~�Nd}~ww�xY�w#�|j���������������������������w�xY�w#�|�j������������������}d|�_��������|�� �|j������������������t��������j ��������������������������nD#�t��������$�r8}|j������������������t��������j������������������k7��rt��������|dd�������dk7��r��Y�d}~nd}~ww�xY�w|j���������������������������w�#�|j���������������������������w�xY�ww�xY�w)z8Close the connection without assuming anything about it.N�winerrorr���i&'��) r���rt���r����shutdownr#���� SHUT_RDWR�OSError�errno�ENOTCONN�getattr)r���r���r����excs��� r���rt���z POP3.close&��s)����� !��9�9�D��D�I���� � ���9�9�D��D�I��� !��M�M�&�"2�"2�3���J�J�L�� �������� � �U�^�^�3�"�3� �A�6�%�?���� ����J�J�L����9�9�D��D�I��� !��M�M�&�"2�"2�3������� � �U�^�^�3�"�3� �A�6�%�?���� ����J�J�L��D�J�J�L��� �sp����%C��A.��. B/�7.B*�%B2��*B/�/B2��2C�E)�C>�=E�> D?�.D:�5E�:D?�?E�E)�E%�%E)c������������������*�����|�j������������������d|z���������S�)z?Send RPOP command to access the mailbox with an alternate user.zRPOP %srQ���rR���s��� r����rpopz POP3.rpopB��s�������~�~�i�$�.�/�/r ���s���\+OK.[^<]*(<.*>)c������������������.����t��������||�j�������������������������}|�j������������������j������������������|�j�������������������������}|st��������d��������ddl}|j������������������d�������|z���}|j������������������|�������j��������������������������}|�j������������������d|�d|���������S�)a��Authorisation - 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 serverr���Nr&���zAPOP � )r/���r0���� timestamp�matchr���r����hashlib�group�md5� hexdigestrG���)r���rS����password�secret�mr�����digests��� r����apopz POP3.apopI��s{��������x����/���N�N� � ����.����A�B�B�������F�"�����V�$�.�.�0���~�~�d�F�;�<�<r ���c������������������0�����|�j������������������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����rh���)r���rf����howmuchs��� r����topzPOP3.top^��s��������}�}�E�7�;�<�<r ���c������������������P�����|�|�j������������������d|z���������S�|�j������������������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] zUIDL %s�UIDLrd���re���s��� r����uidlz POP3.uidlg��s-����������>�>�)�e�"3�4�4��}�}�V�$�$r ���c������������������$�����|�j������������������d�������S�)zITry to enter UTF-8 mode (see RFC 6856). Returns server response. �UTF8rQ���rK���s��� r����utf8z POP3.utf8s��s��������~�~�f�%�%r ���c�����������������������d��}i�} �|�j������������������d�������}|d���}|D�]��}�||�������\��}}|||<����� �|S�#�t��������$�r�t��������d��������w�xY�w)a���Return 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�����|�j������������������d�������j��������������������������}|d���|dd��fS�)N�asciir���r&���)�decoder[���)r,����lsts��� r���� _parsecapzPOP3.capa.<locals>._parsecap���s-�������+�+�g�&�,�,�.�C��q�6�3�q�r�7�?�"r ����CAPAr&���z!-ERR CAPA not supported by server)rI���r���)r���r�����capsr>����rawcaps�capline�capnm�capargss��� r����capaz POP3.capay��sr������ #���� C��=�=��(�D��1�g�G�"��!*�7�!3���w�%��U���#� ������� C��A�B�B� C�s ����-7��Ac����������������������t���������st��������d��������|�j������������������rt��������d��������|�j��������������������������}d|vrt��������d��������|�t ��������j ��������������������������}|�j ������������������d�������}|j������������������|�j������������������|�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 server��server_hostnamer���T)�HAVE_SSLr���r���r�����ssl�_create_stdlib_contextrG����wrap_socketr���r���r���r���)r����contextr����r>���s��� r����stlsz POP3.stls���s������� ���8�9�9�� � ��D�E�E��y�y�{����~��A�B�B��?��0�0�2�G��~�~�f�%���'�'�� � �8<� � ��(��C�� ��I�I�&�&�t�,�� � $����r ���rF���)'r���r���r����__doc__r0���� POP3_PORTr#����_GLOBAL_DEFAULT_TIMEOUTr ���r���r-���r1���r:���r���rD���rG���rI���rL���rO���rS���rV���ra���rC���ri���rk���rn���rq���ru���rt���r�����re�compiler����r����r����r����r����r����r����r ���r ���r���r���r���3���s�������)�V��H�"+��7�7� '�I� '��!�*�"� �#�� �0�0�+�0%�0�1�&�&� �!�80� ��� � �/�0�I�=�*=� %�&��:r ���c��������������������D�����e�Zd�ZdZefej������������������dd�d�Zd��Zdd�Z y)�POP3_SSLaN��POP3 client class over SSL connection Instantiate with: POP3_SSL(hostname, port=995, context=None) hostname - the hostname of the pop3 over ssl server port - port number context - a ssl.SSLContext See the methods of the parent class POP3 for more documentation. N)r���r����c�����������������n�����|�t��������j��������������������������}||�_��������t��������j ������������������|�|||��������y�rF���)r����r����r����r���r ���)r���r���r���r���r����s��� r���r ���zPOP3_SSL.__init__���s.���������4�4�6��"�D�L��M�M�$��d�G�4r ���c�����������������������t���������j������������������|�|�������}|�j������������������j������������������||�j��������������������������}|S�)Nr����)r���r���r����r����r���)r���r���r���s��� r���r���zPOP3_SSL._create_socket���s<�������&�&�t�W�5�D��<�<�+�+�D�<@�I�I��,��G�D��Kr ���c�����������������������t��������d��������)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���)r���r����s��� r���r����z POP3_SSL.stls���s������ ��D�E�Er ���rF���) r���r���r���r����� POP3_SSL_PORTr#���r����r ���r���r����r ���r ���r���r����r�������s,������ ��'4�� 5� &� >� >�� 5� � Fr ���r�����__main__r&���rZ���rY���zMessage %d:z z-----------------------)'r����r{���r����r#���r���r����r�����ImportError�__all__� Exceptionr���r����r����r8����LFr*���r6���r���r����rB���r����argv�ar'���rL���rS���rV���rC���ra����numMsgs� totalSize�range�iri����header�msgr9���r,���ru���r ���r ���r����<module>r�������s|������ �� �� �� ����H���-� ���#�)��"�� � ��� ���� �� �"�u�����v��v�r��F�4��F�@��N�N�:���z����S�X�X�a�[��A� �!�,�,�.���F�F�3�8�8�A�;���G�G�C�H�H�Q�K���F�F�H��6�6�8��W�i� �1�g��k� "�� !���q� ����f� �m�a�� ��D��%�$�,���� �'�(��#���F�F�H����q �����H��s����E��E�E