관리-도구
편집 파일: imaplib.cpython-311.opt-1.pyc
� c��fQ� � �l � d Z dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlmZmZm Z ddlmZ ddlZdZn # e$ r dZY nw xY wg d�Zd ZdZd ZdZdZd Zi dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d�d!d�d"d�d#d�i d$d�d%d�d&d�d'd�d(d�d)d�d*d�d+d�d,d�d-d�d.d�d/d�d0d�d1d�d2d�d3d�d4d��ddddddddd5��Z ej d6� � Z ej d7� � Z ej d8� � Z ej d9ej � � Z ej d:� � Z! ej d;� � Z" ej d<� � Z# ej d=ej � � Z$d9Z%d=Z& G d>� d?� � Z'er# G d@� dAe'� � Z(e�) dA� � G dB� dCe'� � Z* G dD� dE� � Z+dF�, dG� � Z-dH� e.e-dId� � � D � � Z/dJ� Z0dK� Z1dL� Z2dM� Z3e4dNk �r?ddl5Z5ddl6Z6 e5j5 ej7 dId� dO� � \ Z8Z9n# e5j: $ rZ;dP\ Z8Z9Y dZ;[;ndZ;[;ww xY wdZ<e8D ]$\ Z=Z;e=dQk r e>e;� � Z�e=dRk re;Z<e9se<fZ9�%e9sdSZ9e9d Z? e6j@ � � ZA e6j6 dTeA�dUe?pdV�dW�� � ZBdXeAdYdZ�z ZCd[eAeBffd\d]d^d_d`ddeCffdadbdcdddedfdgdhdifZDdjdkdldmd_dddeCffdhdnfZEdo� ZF e<r e*e<� � ZGn e'e?� � ZGeGjH dpk r eDdId� ZDeG�I dqeGjJ z � � eG�I dreGjK ��� � eDD ]\ ZLZ9 eFeLe9� � � eFdsdt� � D ]RZM ejN dueM� � ZOeOreO�P dI� � ZQneM�, � � dv ZQ eFdweQf� � �SeED ]O\ ZLZ9 eFeLe9� � ZReLe9fdlk r�eRdv �, � � ZSeSs�7 eFdxddyeSdv z dzf� � �P eTd{� � dS # eTd|� � es eTd}ej7 d z � � � xY wdS )~z�IMAP4 client. Based on RFC 2060. Public class: IMAP4 Public variable: Debug Public functions: Internaldate2tuple Int2AP ParseFlags Time2Internaldate z2.58� N)�datetime�timezone� timedelta)�DEFAULT_BUFFER_SIZETF)�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP� ParseFlags�Time2Internaldate� � i� )� IMAP4REV1r i@B �APPEND)�AUTH�SELECTED�AUTHENTICATE)�NONAUTH� CAPABILITY)r r r �LOGOUT�CHECK)r �CLOSE�COPY�CREATE�DELETE� DELETEACL�ENABLE)r �EXAMINE�EXPUNGE�FETCH�GETACL� GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr �LSUB�MOVE� NAMESPACE�NOOP�PARTIAL� PROXYAUTH�RENAME�SEARCH�SELECT�SETACL� SETANNOTATION�SETQUOTA�SORT)�STARTTLS�STATUS�STORE� SUBSCRIBE�THREAD�UID�UNSUBSCRIBE�UNSELECTs \+( (?P<data>.*))?s .*FLAGS \((?P<flags>[^\)]*)\)s� .*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s .*{(?P<size>\d+)}$s \r\n|\r|\ns% \[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$ \* (?P<type>[A-Z-]+)( (?P<data>.*))?s3 \* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c �0 � e Zd ZdZ G d� de� � Z G d� de� � Z G d� de� � Zded fd �Z d� Z d� Zd � Zd� Z d� Zd� Zd� Zded fd�Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd � Zd!� Z d"� Z!d#� Z"d$� Z#d%� Z$d&� Z%d'� Z&d(� Z'd)� Z(dZd,�Z)d-� Z*d.� Z+d/� Z,d0� Z-dZd1�Z.d2� Z/d3� Z0d4� Z1d5� Z2d6� Z3d7� Z4d8� Z5d[d;�Z6d<� Z7d=� Z8d>� Z9d?� Z:d\d@�Z;dA� Z<dB� Z=dC� Z>dD� Z?dE� Z@dF� ZAdG� ZBdH� ZCdI� ZDdJ� ZEdK� ZFdL� ZGdM� ZHdN� ZId]dO�ZJdP� ZKdQ� ZLdR� ZMdS� ZNdT� ZOdU� ZPd S )^r a� IMAP4 client class. Instantiate with: IMAP4([host[, port[, timeout=None]]]) host - host's name (default: localhost); port - port number (default: standard IMAP4 port). timeout - socket timeout (default: None) If timeout is not given or is None, the global default socket timeout is used All IMAP4rev1 commands are supported by methods of the same name (in lowercase). All arguments to commands are converted to strings, except for AUTHENTICATE, and the last argument to APPEND which is passed as an IMAP4 literal. If necessary (the string contains any non-printing characters or white-space and isn't enclosed with either parentheses or double quotes) each string is quoted. However, the 'password' argument to the LOGIN command is always quoted. If you want to avoid having an argument string quoted (eg: the 'flags' argument to STORE) then enclose the string in parentheses (eg: "(\Deleted)"). Each command returns a tuple: (type, [data, ...]) where 'type' is usually 'OK' or 'NO', and 'data' is either the text from the tagged response, or untagged results from command. Each 'data' is either a string, or a tuple. If a tuple, then the first part is the header of the response, and the second part contains the data (ie: 'literal' value). Errors raise the exception class <instance>.error("<reason>"). IMAP4 server errors raise <instance>.abort("<reason>"), which is a sub-class of 'error'. Mailbox status changes from READ-WRITE to READ-ONLY raise the exception class <instance>.readonly("<reason>"), which is a sub-class of 'abort'. "error" exceptions imply a program error. "abort" exceptions imply the connection should be reset, and the command re-tried. "readonly" exceptions imply the command should be re-tried. Note: to use this module, you must read the RFCs pertaining to the IMAP4 protocol, as the semantics of the arguments to each IMAP4 command are left to the invoker, not to mention the results. Also, most IMAP servers implement a sub-set of the commands available here. c � � e Zd ZdS )�IMAP4.errorN��__name__� __module__�__qualname__� � �./opt/alt/python311/lib64/python3.11/imaplib.py�errorr? � � � � � � � � � rE rG c � � e Zd ZdS )�IMAP4.abortNr@ rD rE rF �abortrJ � rH rE rK c � � e Zd ZdS )�IMAP4.readonlyNr@ rD rE rF �readonlyrM � rH rE rN � Nc �x � t | _ d| _ d | _ i | _ i | _ d| _ d| _ d| _ d| _ | � � � | � |||� � | � � � d S # t $ r( | � � � n# t $ r Y nw xY w� w xY w)Nr rO Fr )�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect� Exception�shutdown�OSError��self�host�port�timeouts rF �__init__zIMAP4.__init__� s� � ��� ��� ����!���"$���%'��"� ������ %��������� � � �$��g�&�&�&� ��M�M�O�O�O�O�O��� � � � �� � ������� � � ��� ����� ���s0 �1B � B9�B'�&B9�' B4�1B9�3B4�4B9c �� � d| _ d| _ t j t t j � � | _ t j t t j � � | _ d S )NF�ascii) �utf8_enabled� _encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rb s rF r[ zIMAP4._mode_ascii� sC � �!��� ����z�(�B�H�5�5���!�z�*:�B�H�E�E����rE c � � d| _ d| _ t j t � � | _ t j t � � | _ d S )NT�utf-8)ri rj rk rl rm ro rp rq rr s rF � _mode_utf8zIMAP4._mode_utf8� s; � � ��� ����z�(�+�+���!�z�*:�;�;����rE c �� � t t j dd� � � � | _ t j d| j z dz t j � � | _ | � � � | _ d| j v rd| _ n+d | j v rd| _ n| � | j � � �| � � � t* D ]}|| j vr�|| _ d S | � d� � �)Ni i�� s (?P<tag>s"