403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/__pycache__/imaplib.cpython-315.pyc
R
>lqj�#c�,
�Qs]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]QH(G
s
GsGs]QH4Gs]PH>sP	s,QlNsQs]s]�sQsQmsQs-QQnaQ
QoaQQpaQ
QqaQQqaQQqaQQnaQQnaQQnaQQraQQnaQQqaQQqaQQnaQQnaQQnaQQna-QQnaQQnaQQnaQQoaQQpaQQnaQ QqaQ!QnaQ"QpaQ#QqaQ$QraQ%QnaQ&QqaQ'QnaQ(QnaQ)QnaQ*QnaAQ+QqQ,QoQ-QnQ.QqQ/QnQ0QqQ1QqQ2QnQ3Qq-	As\O4Q42s\O4Q52s\O4Q62s\O4Q7\O<2s\O4Q82s \O4Q92s!\O4Q:2s"\O4Q;\O<2s#Q7s$Q;s%\O4Q<2s&\O4Q=2s'\O4Q>2s(\O4Q?2s)QsQ@ks*QAQ2s+QBQC2s,\%cQDQE\+2s-\O]QE2QFQ\+2s/QGQH2s0QIOcQJ2s2\3\2QK*2TTt-tFDvqUOi2U]*aJ	toos5QLs6QMs7QNs8QOs9\:QP6XCc9]PH�s;]PH�s<\;Ov\OzQK*QQ2vs>s?PsA\>FD/vsBsC\BQR6Xc\D\C2sJ\BQS6XfJ \CsA\?%cJ,\A1s?J1	\?%fQus?\?]*sE\<O�2sG\<OxQT\G8QU\E9%fQV8QW02sHQXQY\GQZQ[-*sIQ\\G\H11QvQwQxQ^Q]PP\I11QyQzQ{Q|Q}Q~QQ�Q�1sJQ�Q�Q�Q�Q^PPP\I11Q�Q�1sKQasL\A%c
\/\A2sML\+\E2sM\MO�Q	6Xc
\JQK*sJ\MO�Qb\MO�*2\MO�Qc\MO�802\JFDvsRs?\L\R\?2J	\LQ_Q�2FDQsS\O�Qd\S2sU\U%c\UO�]2sWL\SOc2P*sW\LQe\W12JS	\KFDUvsRs?\L\R\?2sX\R\?1Q�6wcJ\XP*Oc2sY\Y%fJ;\LQ`QQf\YP**Qg12JW	\ZQh2Qks[P!\cP
sCKzh9httooh\;O�c
QtQtts>s?CK<h9h\ZQi2\%f!\ZQj\Oz]**2g9h)�z�IMAP4 client.

Based on RFC 3501.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZE�IMAP4�IMAP4_stream�
��i@B�APPEND�AUTH�AUTHENTICATE�
CAPABILITY�LOGOUT�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�IDLE�MYRIGHTS�LIST�LOGIN�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>.*))?s[
]s[(){ \x00-\x1f\x7f-\xff%*\\"]s[(){ \x00-\x1f\x7f-\xff\\"]s"(?:[^"\\]|\\.)*+"c��[OQU2oVOQ2*UOQ2*
!)��(�))�_quoted�sub�count)�data�depths&&�C:\Python315\\Lib\imaplib.py�_paren_depthr?�s2���;�;�s�D�!�D��:�:�d�#�#�d�j�j��&6�6�6r6c��`�\sQs]�snQsQQ\2sQQ\2sQQ\2sQQ	\	2s
P\P1Q
ksQs
QsQ
sQsQsQsQsP\P1Qks\Q2s\O.Q2sQsQsQsQsQsQsQsQsQs Qs!Qs"Q s#Q!s$Q"s%Q#s&Q$s'Q%s(Q&s)Q's*Q(s+Q)s,Q*s-Q+s.Q,s/QbQ-ks0QcQ.ks1Q/s2Q0s3Q1s4Q2s5QcQ3ks6Q4s7Q5s8Q6s9Q7s:Q8s;Q9s<Q:s=QdQ;ks>Q<s?Q=s@Q>sAQ?sBQbQ@ksCQAsDQBsEQCsFQDsGQEsHQFsIQGsJQHsKQIsLQJsMQKsNQLsOQMsPQNsQQeQOksRQeQPksSQQsTQRsUQSsVQTsWQUsXQVsYQWsZQXs[QYs\QZs]Q[s^Q\s_QbQ]ks`Q^saQ_sbQ`scQasdUseP!)fraIMAP4 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��\sQs]�sQsP!)�IMAP4.error���__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__rCr6r>�errorrB�s��Dr6rJc��\sQs]�sQsP!)�IMAP4.abortrCrDrCr6r>�abortrL�s��r6rMc��\sQs]�sQsP!)�IMAP4.readonlyrCrDrCr6r>�readonlyrO�s��4r6rPc��\sQs]�sQsP!)�IMAP4._responsetimeoutrCrDrCr6r>�_responsetimeoutrR�s��$r6rSc��[UmQUmPUm-Um-UmPUm,UmP
UmP
Um	]Um
P
UmUO2,Um
UOVU2UO2P![ c%SO#2g[$cgh9hh9h�r
)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�_idle_responses�
_idle_capture�is_readonly�tagnum�_tls_established�_mode_ascii�_readbuf�open�_connect�	Exception�shutdown�OSError��self�host�port�timeouts&&&&r>�__init__�IMAP4.__init__�s�����
���
����!���"$���%'��"�!���"��� ������ %���������
�	
�	�	�$�g�&�	��M�M�O���	�
��
�
��
���
���
��	�s<�=B�	B>�B>�B,�+B>�,	B:�6B:�7B>�9B:�:B>c���P
UmQUm[O[[O
2Um[O[[O
2UmP!)F�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rjs&r>rb�IMAP4._mode_ascii�s?��!��� ����z�z�(�B�H�H�5���!�z�z�*:�B�H�H�E��r6c��P	UmQUm[O[2Um[O[2UmP!)T�utf-8)rrrsrtrurvrxryrzr{s&r>�
_mode_utf8�IMAP4._mode_utf8�s3�� ��� ����z�z�(�+���!�z�z�*:�;��r6c��[[OQQ22Um[O
QUO*Q*[O2Um]
Um]Um	-Um
UO]6�c#UOQUO*2UO2UmQUO7c	QUmLuQUO7c	QUmL\UO9%fUO"O$O'UO(Q	2oUO+Q
U*2gUO-2UO]6�c UOQUO.802[0FDoV O.7fJV mP!	UO+Q2g)
ii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)znew IMAP4 connection, tag=%s�PREAUTHr
�OK�NONAUTH�replacezinvalid greeting: zCAPABILITIES: zserver not IMAP4 compliant)�Int2AP�random�randint�tagprertrurw�tagre�_cmd_log_len�_cmd_log_idx�_cmd_logrW�_mesg�
_get_response�welcomer[rX�mo�string�decodersrJ�_refresh_capabilities�capabilities�AllowedVersions�PROTOCOL_VERSION)rj�greeting�versions&  r>re�IMAP4._connect�sj���V�^�^�D�%�8�9����Z�Z���+�+�!&�@�!A�BD�(�(�L��
�� "�D�� !�D���D�M��z�z�Q���
�
�9�D�K�K�G�H��)�)�+�����/�/�/��D�J�
�T�,�,�
,�"�D�J����6�6������>�>����	�+�H��*�*�1�H�<�=�=��"�"�$���z�z�Q���
�
��1B�1B�D�E�&��G��/�/�/��$+�!��	'��j�j�5�6�6r6c�p�U[7c[VO22![QU*2g)zUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rj�attrs&&r>�__getattr__�IMAP4.__getattr__s,���8���4����.�.��:�T�A�B�Br6c��U!�NrCr{s&r>�	__enter__�IMAP4.__enter__%����r6c�t�UOQ6XcP!UO2P![cP!h9hrU)rX�logoutrh)rj�argss&*r>�__exit__�IMAP4.__exit__(s1���:�:��!��	��K�K�M���	��	�s�(�	7�7�7c�D�UdU%f[Q2gUO%fPLUOo[OQVOUO2V O1oUd[
OV12![
OU2!)Nz0Non-blocking socket (timeout=0) is not supportedzimaplib.open)�
ValueErrorrk�sys�auditrl�socket�create_connection)rjrmrk�addresss&&  r>�_create_socket�IMAP4._create_socket5sw����w��O�P�P��9�9�9�t�$�)�)���	�	�.�$�	�	�4�9�9�=����#�����+�+�G�=�=��'�'��0�0r6c��VmV mUOU2UmUOO	Q2UmP!)z�Setup connection to remote server on "host:port"
    (default: localhost:standard IMAP4 port).
This connection will be used by the routines:
    read, readline, send, shutdown.
�rb)rkrlr��sock�makefile�
_imaplib_fileris&&&&r>rd�
IMAP4.openBs9���	��	��'�'��0��	�"�Y�Y�/�/��5��r6c�J�]PHoUOQQQ5UO!��z
IMAP4.file��remove)����warnings�_deprecatedr�)rjr�s& r>�file�
IMAP4.filePs$������\�'��:��!�!�!r6c�B�]PHoUOQQQ5VmP!r�r�)rj�valuer�s&& r>r�r�Vs ������\�'��:�
#�r6c�r�UOoUdUO2P!P![cP!h9hr�)r��closerh)rjr�s& r>�_close_imaplib_file�IMAP4._close_imaplib_file`s:���!�!����
��
�
�����
��
�s�'�	6�6�6c�F�,oU]6�c�[U2[UO26cUO[U2*oLDUOO[2oU%fL�UOO
U2[U2U6�c=UO
UPU2V1P,UO[U2P*UmL%UO
U2U[U2*oJ�QOU2![
cJh9h)�Read 'size' bytes from remote.r6)�lenrcr��recvr�ConnectionError�append�join)rj�size�parts�bufs&&  r>�read�
IMAP4.readhs������Q�h��5�z�C��
�
�.�.��m�m�C��J�/����)�)�.�.�)<�=�C����
�
�$�$�S�)��3�x�4�����S��$�Z�(�!$�U���t�}�}�S��Z�[�/I� I��
���L�L����C��H��D��x�x�����'����s�D�	D �D �D c���Qo,o]oU[6Cc[U2[UO26cUO[U2*oLDUOO	[
2oU%fL�UOOU2UOU2oUP6wcFU]*
oUOUPU2VEP,UO[U2P*UmL&UOU2U[U2*
oCJQOU2o[U2[6�cUOQ[*2gU![cJQh9h)�Read line from remote.�
r6zgot more than %d bytes)�_MAXLINEr�rcr�r�rr�r��findr�rJ)rj�LFr��lengthr��pos�lines&      r>�readline�IMAP4.readline�s(���������x���5�z�C��
�
�.�.��m�m�C��J�/����)�)�.�.�)<�=�C����
�
�$�$�S�)��(�(�2�,�C��b�y��q������S��#�Y�'�!$�T���d�m�m�C��J�K�.H� H��
���L�L����c�#�h��F��x�x�����t�9�x���*�*�5��@�A�A����%'����s�E�	E-�(E-�,E-c�l�[OQV2UOOU2P!)�Send data to remote.zimaplib.send)r�r�r��sendall�rjr<s&&r>�send�
IMAP4.send�s"���	�	�.�$�-��	�	���$�r6c��UO2UOO[O2UOO2P![
c=oSO[O6wc[SQ]2Q6wcgPo=K^Po=hh9hSOO2h9h)� Close I/O established in "open".�winerrori&')
r�r�rgr��	SHUT_RDWRrh�errno�ENOTCONNr�r�)rj�excs& r>rg�IMAP4.shutdown�s���� � �"�
	��I�I���v�/�/�0�
�I�I�O�O����	��	�	�U�^�^�+��3�
�A�.�%�7����
	��
�I�I�O�O��s;�)A�	B�"B�#B�B�B�B"�B�B"�"B>c��UO!)zVReturn socket instance used to connect to IMAP4 server.

socket = <instance>.socket()
)r�r{s&r>r��IMAP4.socket�s��
�y�y�r6c��QoUOQP,U2vq#UP*%cV#1!UO2vq#UOV#U2!)z�Return most recent 'RECENT' responses if any exist,
else prompt server for an update using the 'NOOP' command.

(typ, [data]) = <instance>.recent()

'data' is None if no new messages,
else list of RECENT responses, most recent last.
�RECENTr�)�_untagged_response�noop�rj�name�typ�dats&   r>�recent�IMAP4.recent�sQ�����*�*�4�$���>����r�7�7��8�O��9�9�;����&�&�s��6�6r6c�H�UOUP,UO22!)z�Return data for response 'code' if received, or None.

Old value for response 'code' is cleared.

(code, [data]) = <instance>.response(code)
)r��upper)rj�codes&&r>�response�IMAP4.response�s!���&�&�t�d�V�T�Z�Z�\�B�Br6c��QoU%fQoU%cUOU2oLPoU%c
[U2oLPo[O[U2oV`mUO
VPOU2V#2!)z�Append message to named mailbox.

(typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

        All args except 'message' can be None.
r	�INBOX)�
_set_quote�Time2Internaldate�MapCRLFr:�CRLFrY�_simple_command�_astring)rj�mailbox�flags�	date_time�messager�rYs&&&&&  r>r��IMAP4.append�sj������G���O�O�E�*�E��E��)�)�4�I��I��+�+�d�G�,�����#�#�D�-�-��*@�%�S�Sr6c�0�UO2o[U2OUmUO	QUOU22vqEUQ6wc)UO
UP*OQQ22gQUmUO2VE1!)a#Authenticate command - requires response processing.

'mechanism' specifies which authentication mechanism is to
be used - it must appear in <instance>.capabilities in the
form AUTH=<mechanism>.

'authobject' must be a callable object:

        data = authobject(response)

It will be called to process server continuation responses; the
response argument it is passed will be a bytes.  It should return bytes
data that will be base64 encoded and sent to the server.  It should
return None if the client abort response '*' should be sent instead.
rr�r~r�r
)
r�_Authenticator�processrYr
�_atomrJr�rXr�)rj�	mechanism�
authobject�mechr�r�s&&&   r>�authenticate�IMAP4.authenticates��� ��� ��
&�j�1�9�9����'�'���
�
�4�8H�I����$�;��*�*�S��W�^�^�G�Y�?�@�@���
��"�"�$��x�r6c�R�QoUOU2vq#UOV#U2!)zL(typ, [data]) = <instance>.capability()
Fetch capabilities list from server.r�r
r�r�s&   r>�
capability�IMAP4.capability*s.�����'�'��-����&�&�s��6�6r6c�&�UOQ2!)zBCheckpoint mailbox on server.

(typ, [data]) = <instance>.check()
r)r
r{s&r>�check�IMAP4.check3s��
�#�#�G�,�,r6c�X�UOQ2vqQUmV1!QSmh9h)z�Close currently selected mailbox.

Deleted messages are removed from writable mailbox.
This is the recommended command before 'LOGOUT'.

(typ, [data]) = <instance>.close()
rr
�r
rX�rjr�r�s&  r>r��IMAP4.close;s2��	 ��+�+�G�4�H�C��D�J��x��� �D�J��� �	)c�f�UOQUOU2UOU22!)zrCopy 'message_set' messages onto end of 'new_mailbox'.

(typ, [data]) = <instance>.copy(message_set, new_mailbox)
r)r
�
_sequence_setr)rj�message_set�new_mailboxs&&&r>�copy�
IMAP4.copyJs4��
�#�#�F�D�,>�,>�{�,K�$(�M�M�+�$>�@�	@r6c�F�UOQUOU22!)z@Create new mailbox.

(typ, [data]) = <instance>.create(mailbox)
r�r
r�rjrs&&r>�create�IMAP4.createS� ��
�#�#�H�d�m�m�G�.D�E�Er6c�F�UOQUOU22!)z@Delete old mailbox.

(typ, [data]) = <instance>.delete(mailbox)
rr-r.s&&r>�delete�IMAP4.delete[r1r6c�f�UOQUOU2UOU22!)zpDelete the ACLs (remove any rights) set for who on mailbox.

(typ, [data]) = <instance>.deleteacl(mailbox, who)
rr-)rjr�whos&&&r>�	deleteacl�IMAP4.deleteaclbs0��
�#�#�K����w�1G�$(�M�M�#�$6�8�	8r6c���QUO7c[OQ2gUOQU2vq#UQ6Xc&QUO	27cUO2V#1!)z\Send an RFC5161 enable string to the server.

(typ, [data]) = <instance>.enable(capability)
rzServer does not support ENABLEr�zUTF8=ACCEPT)r�rrJr
rr)rjrr�r<s&&  r>�enable�IMAP4.enablejs_��
�4�,�,�,��+�+�>�?�?��(�(��:�>�	���$�;�=�J�,<�,<�,>�>��O�O���y�r6c�R�QoUOU2vq#UOV#U2!)z�Permanently remove deleted items from selected mailbox.

Generates 'EXPUNGE' response for each deleted message.

(typ, [data]) = <instance>.expunge()

'data' is list of 'EXPUNGE'd message numbers in order received.
rrr�s&   r>�expunge�
IMAP4.expungevs.�����'�'��-����&�&�s��6�6r6c��QoUOV0OU2UOU22vqEUOVEU2!)z�Fetch (parts of) messages.

(typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

'message_parts' should be a string of selected parts
enclosed in parentheses, eg: "(UID BODY[TEXT])".

'data' are tuples of message part envelope and data.
r)r
r'�_fetch_partsr�)rjr(�
message_partsr�r�r�s&&&   r>�fetch�IMAP4.fetch�sJ�����'�'��.@�.@��.M�(,�(9�(9�-�(H�J����&�&�s��6�6r6c�n�UOQUOU22vq#UOV#Q2!)zHGet the ACLs for a mailbox.

(typ, [data]) = <instance>.getacl(mailbox)
r�ACL�r
rr��rjrr�r�s&&  r>�getacl�IMAP4.getacl�s4��
�'�'��$�-�-��2H�I����&�&�s��7�7r6c�p�UOQUOU2V#2vqEUOVEQ2!)zY(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
Retrieve ANNOTATIONs.r�
ANNOTATIONrF)rjr�entry�	attributer�r�s&&&&  r>�
getannotation�IMAP4.getannotation�s9���'�'�����w�9O�(-�:����&�&�s��>�>r6c�n�UOQUOU22vq#UOV#Q2!)z�Get the quota root's resource usage and limits.

Part of the IMAP4 QUOTA extension defined in rfc2087.

(typ, [data]) = <instance>.getquota(root)
r�QUOTArF)rj�rootr�r�s&&  r>�getquota�IMAP4.getquota�s4���'�'�
�D�M�M�$�4G�H����&�&�s��9�9r6c��UOQUOU22vq#UOV#Q2vq$UOV#Q2vq%V%U,1!)z�Get the list of quota roots for the named mailbox.

(typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
rrQ�	QUOTAROOTrF)rjrr�r��quota�	quotaroots&&    r>�getquotaroot�IMAP4.getquotaroot�sW��
�'�'���
�
�g�8N�O����,�,�S�w�?�
���0�0��;�G�����&�&�&r6c��[V2!)a+Return an iterable IDLE context manager producing untagged responses.
If the argument is not None, limit iteration to 'duration' seconds.

with M.idle(duration=29 * 60) as idler:
    for typ, data in idler:
        print(typ, data)

Note: 'duration' requires a socket connection (not IMAP4_stream).
)�Idler)rj�durations&&r>�idle�
IMAP4.idle�s���T�$�$r6c��QoUOV0OU2UOU22vqEUOVEU2!)z�List mailbox names in directory matching pattern.

(typ, [data]) = <instance>.list(directory='', pattern='*')

'data' is list of LIST responses.
r�r
r�
_list_mailboxr��rj�	directory�patternr�r�r�s&&&   r>�list�
IMAP4.list��H�����'�'��m�m�I�.F�(,�(:�(:�7�(C�E����&�&�s��6�6r6c��UOQUOU2UOU22vq4UQ6wc)UOUP*O	QQ22gQUmUO
2V41!)z|Identify client using plaintext password.

(typ, [data]) = <instance>.login(user, password)

NB: 'password' will be quoted.
rr�zUTF-8r�r
)r
r�_quoterJr�rXr�)rj�user�passwordr�r�s&&&  r>�login�IMAP4.login�sn���'�'�����t�1D�(,���H�(=�?����$�;��*�*�S��W�^�^�G�Y�?�@�@���
��"�"�$��x�r6c�X�VtUmUmUOQUO2!)zaForce use of CRAM-MD5 authentication.

(typ, [data]) = <instance>.login_cram_md5(user, password)
zCRAM-MD5)rkrlr�_CRAM_MD5_AUTH)rjrkrls&&&r>�login_cram_md5�IMAP4.login_cram_md5�s+��
$(� ��	�4�=�� � ��T�-@�-@�A�Ar6c�@�]PHo[UO[2%cUOO	Q2oLUOoUOV1Q2oUOQUO20![cSOQ2gh9h)z0Authobject to use with CRAM-MD5 authentication. r~�md5z(CRAM-MD5 authentication is not supported� )
�hmac�
isinstancerl�str�encode�HMACr�rJrk�	hexdigest)rj�	challengervrl�authcodes&&   r>rp�IMAP4._CRAM_MD5_AUTH�s�����d�m�m�S�)�)��}�}�+�+�G�4�H��}�}�H�	I��y�y��e�<�H��)�)��A�h�0�0�2�3�4�4���	I��*�*�G�H�H�	I�s�B�	B�
Bc�^�QUmUOQ2vqUO2V1!)zdShutdown connection to server.

(typ, [data]) = <instance>.logout()

Returns server 'BYE' response.
r
)rXr
rgr#s&  r>r��IMAP4.logout�s-����
��'�'��1����
�
���x�r6c��QoUOV0OU2UOU22vqEUOVEU2!)z�List 'subscribed' mailbox names in directory matching pattern.

(typ, [data, ...]) = <instance>.lsub(directory='', pattern='*')

'data' are tuples of message part envelope and data.
r rarcs&&&   r>�lsub�
IMAP4.lsubrhr6c�n�UOQUOU22vq#UOV#Q2!)zsShow my ACLs for a mailbox (i.e. the rights that I have on mailbox).

(typ, [data]) = <instance>.myrights(mailbox)
rrFrGs&&  r>�myrights�IMAP4.myrightss4��
�&�&�z�4�=�=��3I�J����&�&�s��<�<r6c�R�QoUOU2vq#UOV#U2!)zQReturns IMAP namespaces ala rfc2342

(typ, [data, ...]) = <instance>.namespace()
r"rr�s&   r>�	namespace�IMAP4.namespace s.��
���'�'��-����&�&�s��6�6r6c��UO]6�cUOUO2UOQ2!)z6Send NOOP command.

(typ, [data]) = <instance>.noop()
r#)rW�_dump_urr[r
r{s&r>r��
IMAP4.noop*s5��
��z�z�Q���
�
�d�5�5�6��#�#�F�+�+r6c�V�QoUOVQV#U2vqgUOVgQ2!)z�Fetch truncated part of a message.

(typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

'data' is tuple of message part envelope and data.
r$rr)rj�message_num�message_part�startr�r�r�r�s&&&&&   r>�partial�
IMAP4.partial5s3�����'�'��<�PV�W����&�&�s��9�9r6c�H�QoUOV OU22!)z�Assume authentication as "user".

Allows an authorised administrator to proxy into any user's
mailbox.

(typ, [data]) = <instance>.proxyauth(user)
r%r-)rjrkr�s&& r>�	proxyauth�IMAP4.proxyauthAs#�����#�#�D�-�-��*=�>�>r6c�f�UOQUOU2UOU22!)z[Rename old mailbox name to new.

(typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
r&r-)rj�
oldmailbox�
newmailboxs&&&r>�rename�IMAP4.renameNs0��
�#�#�H�d�m�m�J�.G�$(�M�M�*�$=�?�	?r6c��QoUdQUO%c[OQ2gUOUQUO	U2,UN3vqELUOU,UN3vqEUOVEU2!)z�Search mailbox for matching messages.

(typ, [data]) = <instance>.search(charset, criterion, ...)

'data' is space separated list of matching message numbers.
If UTF8 is enabled, charset MUST be None.
r'z'Non-None charset not valid in UTF8 mode�CHARSET)rrrrJr
rr�)rj�charset�criteriar�r�r�s&&*   r>�search�IMAP4.searchWs�������� � � ��k�k�"K�L�L��+�+�D��t�}�}�W�5�B�8@�B�H�C���+�+�D�<�8�<�H�C��&�&�s��6�6r6c��-UmV mU%cQoLQoUOV0OU22vqEUQ6wcQUmVE1!QUmQUO7cKU%fCUO
]6�cUO
UO2UOU8Q02gV@OOQP,21!)	aDSelect a mailbox.

Flush all untagged responses.

(typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

'data' is count of messages in mailbox ('EXISTS' response).

Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
other responses should be obtained via <instance>.response('FLAGS') etc.
rr(r�r
�SELECTED�	READ-ONLYz is not writable�EXISTS)	r[r_r
rrXrWr�rP�get)rjrrPr�r�r�s&&&   r>�select�IMAP4.selectjs���#%���#����D��D��'�'��m�m�G�.D�E����$�;��D�J��8�O���
��$�1�1�1� ���:�:��?��M�M�$�"9�"9�:��-�-�� A�B�B��+�+�/�/��4�&�A�A�Ar6c��UOQUOU2UOU2UOU22!)zJSet a mailbox acl.

(typ, [data]) = <instance>.setacl(mailbox, who, what)
r)r-)rjrr6�whats&&&&r>�setacl�IMAP4.setacl�s=��
�#�#�H�d�m�m�G�.D�$(�M�M�#�$6��
�
�d�8K�M�	Mr6c�v�UOQUOU2,UN3vq4UOV4Q2!)zW(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
Set ANNOTATIONs.r*rKrF)rjrr�r�r�s&&*  r>�
setannotation�IMAP4.setannotation�s:���'�'�����w�9O�W�RV�W����&�&�s��>�>r6c��UOQUOU2UOU22vq4UOV4Q2!)zYSet the quota root's resource limits.

(typ, [data]) = <instance>.setquota(root, limits)
r+rQ�r
rrr�)rjrR�limitsr�r�s&&&  r>�setquota�IMAP4.setquota�sC��
�'�'�
�D�M�M�$�4G�(,����(?�A����&�&�s��9�9r6c��QoUOU2oUdUOU2oUOVAU,UN3vqVUOVVU2!)zqIMAP4rev1 extension SORT command.

(typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
r,)rrr
r�)rj�
sort_criteriar��search_criteriar�r�r�s&&&*   r>�sort�
IMAP4.sort�sY��
�����
�6�
����m�m�G�,�G��'�'��W�W��W����&�&�s��6�6r6c�^�Qo[%fUOQ2gUO%cUOQ2gV O7cUOQ2gUe[
O2oUOU2vq4UQ6XcuUO2UOUOUOQ5Um
UOOQ2Um
P	UmUO2LUOQ2gUOV4U2!)r-zSSL support missingzTLS session already establishedzTLS not supported by serverr���server_hostnamer�zCouldn't establish TLS session)�HAVE_SSLrJrarMr��ssl�_create_stdlib_contextr
r��wrap_socketr�rkr�r��_get_capabilitiesr�)rj�ssl_contextr�r�r�s&&   r>�starttls�IMAP4.starttls�s�����x��*�*�2�3�3�� � � ��*�*�>�?�?��(�(�(��*�*�:�;�;����4�4�6�K��'�'��-����$�;��$�$�&�#�/�/��	�	�@D�	�	�0�K�D�I�!%���!3�!3�D�!9�D��$(�D�!��"�"�$��*�*�=�>�>��&�&�s��6�6r6c��QoUOV0OU2UOU22vqEUOVEU2!)z`Request named status conditions for mailbox.

(typ, [data]) = <instance>.status(mailbox, names)
r.r�)rjr�namesr�r�r�s&&&   r>�status�IMAP4.status�sH��
���'�'��m�m�G�.D�(,����(>�@����&�&�s��6�6r6c��UOU2oUOQUOU2V#2vqEUOVEQ2!)zqAlters flag dispositions for messages in mailbox.

(typ, [data]) = <instance>.store(message_set, command, flags)
r/r)rr
r'r�)rjr(�commandr
r�r�s&&&&  r>�store�IMAP4.store�sI��
����&���'�'���1C�1C�K�1P�(/�8����&�&�s��9�9r6c�F�UOQUOU22!)zISubscribe to new mailbox.

(typ, [data]) = <instance>.subscribe(mailbox)
r0r-r.s&&r>�	subscribe�IMAP4.subscribe�s ��
�#�#�K����w�1G�H�Hr6c��QoUdUOU2oUOV@OU2U,UN3vqVUOVVU2!)z{IMAPrev1 extension THREAD command.

(type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
r1)rr
rr�)rj�threading_algorithmr�r�r�r�r�s&&&*   r>�thread�IMAP4.thread�s[��
�����m�m�G�,�G��'�'��j�j�9L�.M�(/�C�2A�C����&�&�s��6�6r6c��UO2oU[7fUOQU802gUO[U*7cBUOQU8QUO8QQO	[U*2802gQoUQ6Xc(UvqEUOU2UO
U21oL�UQ6Xc(UvqFUOU2UOU21oL�UQ	6Xc*UvqGoUOU2UUOU21oLmUQ
6Xc1Uuq�oU
dUO
U
2o
UOU	2U
,UN3oL6UQ6Xc0Uuq�oU
dUO
U
2o
UOU2U
,UN3oUOV0OU2,UN3vq�UQ7cSoLQoUOV�U2!)
z�Execute "command arg ..." with messages identified by UID,
        rather than message number.

(typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

Returns response appropriate to 'command'.
zUnknown IMAP4 UID command: �command � illegal in state �, only allowed in states �, r2rrr/r,r1)r'r,r1)rr�rJrXr�r'rr@rrr
r�)rjr�r�r�r(r)rA�opr
r�r�r�r�r�r�s&&*            r>�uid�	IMAP4.uid�s����-�-�/���(�"��*�*��I�J�J��:�:�X�g�.�.��*�*�%�t�z�z�"�i�i���(9�:�<�=�
=����f��'+�$�K��&�&�{�3��M�M�+�.�0�D�
��
�)-�&�K��&�&�{�3��%�%�m�4�6�D�
��
�%)�"�K�U��&�&�{�3�R��O�O�E�*�,�D�
��
�7;�4�M�_��"��-�-��0���O�O�M�2�G�&�$�&�D�
��
 �=A�:��?��"��-�-��0���J�J�2�3�W�&�$�&�D��'�'��j�j��.A�I�D�I����2�2��D��D��&�&�s��6�6r6c�F�UOQUOU22!)zOUnsubscribe from old mailbox.

(typ, [data]) = <instance>.unsubscribe(mailbox)
r3r-r.s&&r>�unsubscribe�IMAP4.unsubscribe*s ��
�#�#�M�4�=�=��3I�J�Jr6c�X�UOQ2vqQUmV1!QSmh9h)aFree server's resources associated with the selected mailbox
and returns the server to the authenticated state.
This command performs the same actions as CLOSE, except
that no messages are permanently removed from the currently
selected mailbox.

(typ, [data]) = <instance>.unselect()
r4r
r")rjr�r<s&  r>�unselect�IMAP4.unselect2s3��	 ��,�,�Z�8�I�C��D�J��y��� �D�J�r%c��UO2oU[7fUO1[U$UOU,UN3!)z�Allow simple extension commands
        notified by server in CAPABILITY response.

Assumes command is legal in current state.

(typ, [data]) = <instance>.xatom(name, arg, ...)

Returns response appropriate to extension command 'name'.
)rr�rXr
�rjr�r�s&&*r>�xatom�IMAP4.xatomBs>���z�z�|���x��"�j�j�]�H�T�N��#�#�D�0�4�0�0r6c��UeQoUO%c�UO%c6[UOP*]*P*[2%cUOO	V,12L;UOP*oU]*U6XfPgU]*O	U2UO
]6�cUO
QUQU802P!UOoUO
]6�c8UO
QU8Q[UOUP228QU8Q02V7cVA*O	U2P!U,VA$P!)Nr6zidle: queue untagged ru�untagged_responses[z] z += ["z"])
r^r]rw�bytesr�rWr�r[r�r�)rjr�r�r�urs&&&  r>�_append_untagged�IMAP4._append_untaggedXs���;��C������(�(�(��4�/�/��3�A�6�r�:�E�B�B��$�$�+�+�S�%�L�9� �/�/��3����{�c�)�)�)����"�"�3�'�!�Z�Z�1�_��
�
�2�3�%�q���@�A��
�
$�
$����z�z�Q���
�
��c�"�&�&��R�.�1�3�8�9��9��G�N�N�3���e�B�Gr6c��UOOQ2oU%c3UOUP*OUOQ22gP!)�BYEr�)r[r�rMr�rs)rj�byes& r>�
_check_bye�IMAP4._check_byexsB���%�%�)�)�%�0����*�*�S��W�^�^�D�N�N�I�F�G�G�r6c��UO[U*7cIPUmUOQU8QUO8QQO	[U*2802gQFD"oV0O
7fJUO
UJ$	QUO
7c$UO%fUOQ2gUO2o[VO2oUQ*U*oSFDjoUeJ	[U[2%c[V`O2o[OU2%c[Q2gUQ*U*oJl	UOoUd�PUm[!U2[!UO"2IcSoLxPoUO$%c8U[Q	['U2*UO2*oUQ
*oL-U[Q['U2*UO2*oUO(]6�cUO+QU*2LUO-QU*2UO/U[0*2UeU!UO72%cUO8U*%fJ1U!W%cUUO:2oUO(]6�c"UO+Q['U2*2UO/U2UO/[02U%cJ�U![2co	SO5Q
S	*2gPo	=	hh9h[2co	SO5Q
S	*2gPo	=	hh9h)Nr�r�r�r�r�z#mailbox status changed to READ-ONLY� z&NUL, CR and LF not allowed in commandsz UTF8 (~{%s}r8z {%s}z> %rzsocket error: %szwrite literal size %s�r��NO�BAD)rXr�rYrJr�r[r_rP�_new_tagr�rsrwrx�_control_charsr�r��type�_commandrrr�rWr��_logr�r	rhrMr�rZr\)
rjr�r�r��tagr<�argrY�	literator�vals
&&*       r>r��IMAP4._command~s����:�:�X�d�^�+��D�L��*�*�"�D�J�J�"�i�i����7�9�:�
:�
'�C��-�-�-��+�+�C�0�'��$�1�1�1�� � � ��-�-� E�F�F��m�m�o���T�>�>�*���T�z�D� ���C��{�H��#�s�#�#��C���0���$�$�S�)�)� �!I�J�J��$�;��$�D�
��,�,�����D�L��G�}��T�]�]� 3�3�#�	� �	��$�$�$��%���W��(E�t�~�~�"V�V�D�%��n�G��%��#�g�,�(>����"O�O�D���z�z�Q���
�
�6�D�=�)��	�	�&�4�-�(�	7��I�I�d�T�k�"��?��J���$�$�&�&��'�'��,�,��J��#�D�$>�$>�?����:�:��?��J�J�6��W��E�F�
;��	�	�'�"��	�	�$���9���
��?�	7��*�*�/�#�5�6�6��	7��2�
;��j�j�!3�c�!9�:�:��
;�s<�!L8�&M#�8	M �M �M�M �#	N�-N�.N�Nc��UQ6HoU%fUO2UOV#Q5vqEU%fUO2UQ6XcUOU8QU8QU802gVE1!SOcoSOQS8QS802gPo=hSOcoSOQS8QS802gPo=hh9h)r
)�
expect_byez	command: � => r�z command error: ru)r��_get_tagged_responserMrJ)rjr�r�r�r�r<r�s&&&    r>�_command_complete�IMAP4._command_complete�s����(�"����O�O��	@��1�1�#�1�I�I�C�
��O�O���%�<��*�*�$��T�J�K�K��y����z�z�	@��*�*�D�#�>�?�?���z�z�	@��*�*�D�#�>�?�?��	@�s/�A2�2C�C�B�C�/C�0C	�	Cc���UO2vqUP,6XcUOQ2g[UP*UO2oUO	2o[UO
22UmP!)Nz"no CAPABILITY response from server)rrJrxrsr�tuple�splitr�r#s&  r>r��IMAP4._get_capabilities�s[���?�?�$����4�&�=��*�*�A�B�B��#�b�'�4�>�>�*���i�i�k��!�#�)�)�+�.��r6c��QUO7cdUOOQ2P*o[[VO2O2O
22UmP!UO2P!)r)	r[�poprrxrsrrr�r�)rjr�s& r>r��IMAP4._refresh_capabilities�s_���4�2�2�2��)�)�-�-�l�;�B�?�C� %�c�#�~�~�&>�&D�&D�&F�&L�&L�&N� O�D���"�"�$r6c���UP
Ic�UO%cqUd
U]6�fPgUOO2oUOOU2UO2oUOOU2LUO2oUQ6XcUO2oJUO
UOU2%c�UOOQ2oVPO7fUOQU*2gUOOQ2o[V`O2oUOOQ2oVg,1UOU$CLPoUO
[U2%f>UO
UOU2%cUOOQ2oUOeWUO
[ U2%c#UOOQ2UmP!UOQU*2gUOOQ2o[V`O2oUOOQ2oUeQoU%cUQ*U*o]o	UO
UO$U2%c�['UOOQ	22o
UO(]6�cUO+Q
U
*2UO-U
2oUO/VgU12[1Vy2o	UO2oUQ6XfJ�U	]6�fJ�UO2oJ$UO/Vg2UQ7cwUO
[2U2%c[UOOQ2o[V`O2oUO/V`OOQ22UO(]6�c UQ
7cUO+U8QU802U![coSO
SgPo=hh9hSOOS2h9h)Fr6r�zunexpected tagged response: %rr�r<�data2zunexpected response: %rr�r�zread literal size %sz response: r�)r�r�r�)r��
gettimeout�
settimeout�	_get_line�TimeoutErrorrS�_matchr�r��grouprZrMrxrs�Untagged_responserz�Continuationr\rx�intrWr�r�r�r?�
Response_code)rj�
start_timeout�
saved_timeout�resp�errr�r�r��dat2r=r�r<s&&          r>r��IMAP4._get_response�sf����%�$�)�)�)� �(�M�A�,=�=�=� �I�I�0�0�2�M��I�I� � ��/�
4��~�~�'���	�	�$�$�]�3��>�>�#�D��c�k��>�>�#�D��;�;�t�z�z�4�(�(��'�'�-�-��&�C��.�.�.��j�j�!A�D�!H�I�I��'�'�-�-��'�C��c�>�>�*�C��'�'�-�-��'�C�),�e��D� � ��%��D��;�;�0�$�7�7��;�;�t�3�3�T�:�:��7�7�=�=��1�D��w�w���;�;�|�T�2�2�15�����v�1F�D�.���j�j�!:�T�!A�B�B��'�'�-�-��'�C��c�>�>�*�C��'�'�-�-��'�C��{�#�C��3��:��,�S��E��+�+�d�l�l�C�0�0��4�7�7�=�=��0�1����z�z�Q���
�
�#9�D�#@�A��y�y�����%�%�c��;�7�$�S�0���n�n�&���S�j�U�Q�Y��.�.�*�C��!�!�#�+��%�%�$�+�+�m�S�*I�*I��'�'�-�-��'�C��c�>�>�*�C��!�!�#�w�w�}�}�V�'<�=���z�z�Q��3�*>�#>��
�
��S�9�:����o �
5��+�+��4��
5���	�	�$�$�]�3�s*�P4�4	Q�>Q�?
Q�Q�Q�Q1c�b�UOU*oUdUOUU!U%c&QoUOOUP2oUdVE1!UO2UO	2JwSO
c%SO]6�cSO2gh9h)�r�)rZr[r
r�r�rMrW�	print_log)rjr�r�resultr�r�s&&&   r>r�IMAP4._get_tagged_response`s�����)�)�#�.�F��!��(�(��-��
�����-�-�1�1�#�t�<���?��:�%�
�O�O��
��"�"�$���:�:�
���z�z�Q�����(��	
�s�'A9�9B.�	B.�B.c�J�UO2oU%fUOQ2gUOQ2%fUOQU*2gUPQoUO]6�cUO	QU*2U!UOQU*2U!)zsocket error: EOFrz#socket error: unterminated line: %rz< %r���)r�rM�endswithrWr�r��rjr�s& r>r�IMAP4._get_line�s����}�}�����*�*�0�1�1��}�}�W�%�%��*�*�B�T�I�J�J��C�R�y����z�z�Q���
�
�6�D�=�)����	�	�&�4�-�(��r6c��UOU2UmUOdMUO]6�c<UOQUO8QUOO2802UOPI!)Tz		matched r)�matchr�rWr�re�groups)rj�cre�ss&&&r>r�IMAP4._match�sY��
�)�)�A�,�����w�w�"�t�z�z�Q���
�
�3�;�;������@P�Q�R��w�w�d�"�"r6c���UO[[UO2UO2*oUO]*UmPUO
U$U!�r)r�r�rxr`rsrZ)rjr�s& r>r��IMAP4._new_tag�sH���k�k�E�#�d�k�k�"2�D�N�N�C�C���k�k�A�o���$(����S�!��
r6c��U!r�rC�rjr�s&&r>r�IMAP4._atom�����
r6c��U!r�rCr2s&&r>r'�IMAP4._sequence_set�r4r6c�p�U%cU]*Q6XcUP*Q6XcU!QU*Q*!)r��(�)rCr2s&&r>r�IMAP4._set_quote�s,���3�q�6�S�=�S��W��^��J��S�y�3��r6c�T�UO2Q7cU!UOU2!)�ALL)r<�FULL�FAST)rrr2s&&r>r@�IMAP4._fetch_parts�s'���9�9�;�1�1��J����s�#�#r6c���[U[2%c[VO2oUO	QQ2oUO	QQ2oQU*Q*!)�\s\\�"s\")rwrxr�rsr�r2s&&r>rj�IMAP4._quote�sL���c�3�����^�^�,�C��k�k�%��(���k�k�$��'���c�z�D� � r6c��[U[2%c[VO2o[OU2%cU!U%c[OU2eU!UOU2!r�)	rwrxr�rsr9�	fullmatch�_non_astring_charr�rjr2s&&r>r�IMAP4._astring�s[���c�3�����^�^�,�C����S�!�!��J��$�+�+�C�0�8��J��{�{�3��r6c��[U[2%c[VO2o[OU2%cU!U%c[OU2eU!UOU2!r�)	rwrxr�rsr9rE�_non_list_charr�rjr2s&&r>rb�IMAP4._list_mailbox�sZ���c�3�����^�^�,�C����S�!�!��J��>�(�(��-�5��J��{�{�3��r6c�L�UOVOU,UN32!r�)rr�r�s&&*r>r
�IMAP4._simple_command�s!���%�%�d�M�M�$�,F��,F�G�Gr6c���UQ6XcV1!V0O7fUP,1!UOOU2oUO]6�cUOQU8QU802V1!)r�r�z] => )r[r
rWr�)rjr�r�r�r<s&&&& r>r��IMAP4._untagged_response�se���$�;��8�O��.�.�.����;���&�&�*�*�4�0����z�z�Q���
�
�T�4�H�I��y�r6c�8�Ue[O2o[OQ[OU22o[OOQV2]d*]d*U1*2[OO
2P!)Nz%M:%Sz
  %s.%02d %s
)�time�strftime�	localtimer��stderr�write�flush)rjr,�secs�tms&&& r>r��IMAP4._mesg�s`���|��y�y�{�����w����t�(<�=�B��J�J���-��3�h��^�Q�0G�G�H��J�J���r6c��U%fP!QUO22oUOQQOU2*2P!)Nc3�B�SF �DvqUQU80w�	J	P!3h)�: rC)�.0�keyr�s&  r>�	<genexpr>�!IMAP4._dump_ur.<locals>.<genexpr>�s#��&@���&@�
���u�B�u�i�(�&@�s�zuntagged responses dump:z
		)�itemsr�r�)rj�untagged_resp_dictr`s&& r>r��IMAP4._dump_ur�s=��%��B�&8�&>�&>�&@�B�E��J�J�1�H�M�M�%�4H�H�Ir6c���U[O21UOUO$U9O]*
tmUOUO6�c
]UmP!P!r/)rPr�r�r�r&s&&r>r��
IMAP4._log�sS��04�d�i�i�k�/B�D�M�M�$�+�+�,�����"��� � �D�$5�$5�5�$%��!�6r6c�<�UOQ[UO2*2UOUOq!U%cJUOUOU*U]*
oVO6�c]oU]*oJQP!K,9h)zlast %d IMAP4 interactions:)r�r�r�r�r�)rj�i�ns&  r>r �IMAP4.print_logs����J�J�4�s�4�=�=�7I�I�J��$�$�d�&7�&7�q����J�J��
�
�a� 0�1��Q����)�)�)��A��Q�������s�
"B�B)rxr�rzr�r�r�rsr^r]r�rcrar�r\rWrkr_rYr�rlrlr�rXrZr`r�r�r[rkrrr�r�)��*)rF)F)frErFrGrH�__doc__rfrJrMrPrrS�
IMAP4_PORTrnrbrrer�r�r�r�rd�propertyr��setterr�r�r�r�rgr�r�rr�rrrr�r*r/r3r7r:r=rBrHrNrSrYr^rfrmrqrpr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�rrrr�rr'rr@rjrrbr
r�r�r�r�r rI�__classdictcell__��
__classdict__s@r>rr�s6����-�^!�	� �����5��.�<�.��Z���8F�<�*7�ZC���1���T�6��"��"�

�[�[�#��#��%�P!�H �
� �7�"C�T�.�<7�-��@�F�F�8�
�7�
7� 8�?�:�'�
%�
7�
� B�
5� 
�
7�=�7�,�	:�
?�?�7�&B�@M�?�:�7�7�0
7�:�I�
7�.7�bK�
� 1�,�@H�P�f�$/�%�h�V�B�&	#�����
$�!� � �H�
	��	�	J�	&�	�	r6c�\`�\sQsQsnQsQQksQsQsQsQQks	Qs
Q
Q	ksQ
sUs
P!)r\iz�Iterable IDLE context manager: start IDLE & produce untagged responses.

An object of this type is returned by the IMAP4.idle() method.

Note: The name and structure of this class are subject to change.
c���QUO7cUOQ2gUd$UO%fUOQ2gV mPUmVmPUmPUmP!)rz"Server does not support IMAP4 IDLEz%duration requires a socket connection)r�rJr��	_duration�	_deadline�_imap�_tag�_saved_state)rj�imapr]s&&&r>rn�Idler.__init__s^����*�*�*��*�*�A�B�B����	�	�	��*�*�D�E�E�!������
���	� ��r6c�b�UOoUO%cPgUO%cPgUO]6�cUO	QUO
02P	UmUO
Q2UmUO29o%c|UOUO*%fJ=UOOUO2vq4UQ6XcUOQU02gUOQU02gUO]6�c!UOoUO	QU02UO
d,[O 2UO
*UmUO$UmQUmU![c
P
Smgh9h)Tzidle start duration=rr�z
idle denied: zunexpected status response: zidle continuation prompt: �IDLING)rvr]r^rWr�rtr�rwr�rZr
rJrMr\�
BaseExceptionrP�	monotonicrurXrx)rjryrr�r<�prompts&     r>r��Idler.__enter__"sn���z�z���'�'�'�'�'��%�%�%�%�%����q���J�J�-�d�n�n�-=�>�?�
"���	��
�
�f�-�D�I��,�,�.�.�$�.��'�'��	�	�2�2� $� 4� 4� 8� 8���� C�I�C��d�{�"�j�j�=���)?�@�@��*�*�'C�D�6�%J�K�K�!�Z�Z�1�_��3�3���
�
�7��x�@�A�
�>�>�%�!�^�^�-����>�D�N� �J�J�����
�����	�!&�D���	�s*�--F� F�-F�.8F�' F�	F.�$
F.c��UOoUO]6�cUOQ2UOUmP
Um[
UO29o%csUO]6�cUOQUQ02UO%c;UOO]2vqgSFDoUOVh2J	JLUOQ[*2UOQUO2vo	vo
UO]6�cUOQU	QU
802P
![cS%fgP
!h9h)Tz	idle donezidle quit with z leftover responsessDONErz
idle status: ru)rvrWr�rxrXr^r�r]r
r�r�r	rrwrh)rj�exc_type�exc_val�exc_tbry�	leftoversr�r<�datumr��msgs&&&&       r>r��Idler.__exit__Ms)���z�z�����q���J�J�{�#��&�&��
�#����D�0�0�1�1�9�1�!�Z�Z�1�_��
�
�_�Y�K�7J�K�L��&�&�&� �0�0�4�4�Q�7�	��!�E��)�)�#�5�"�	��I�I�g��n�%� �2�2�6�4�9�9�E�M�F�E�S�!�Z�Z�1�_��
�
�]�6�(�!�C�7�;�<�
��	�	�����		�s%�A
E�&E�	E�
E�E�Ec��U!r�rCr{s&r>�__iter__�Idler.__iter__sr�r6c���UOoUOQ6wcUOQ2gUO%cMUOO	]2oUO
]6�cUO
QUQU]*02U!UO
]6�cUO
QUQ02UdU]6:cU![U2oUOU2UOO	]2oUO
]6�cUO
QUQU]*02U![Oc,SO
]6�cSO
QSQ02St!h9h)r|z_pop() only works during IDLEz
idle _pop(z) de-queued z	) readingz) donez) read )rvrXrJr]r
rWr��floatr�rrS)rjrm�defaultryrs&&&  r>�_pop�
Idler._popvsG��$�z�z���:�:��!��*�*�<�=�=������'�'�+�+�A�.�D�!�Z�Z�1�_��
�
�Z��y��T�!�W�I�F�G��K����q���J�J��G�9�I�6�7����!�|����G�n�G�	����w�'��#�#�'�'��*�����q���J�J��G�9�G�D��G�9�=�>�����%�%�	�!�Z�Z�1�_��
�
�Z��y��7�8��N�	�s�
D*�*E*�>E*�E*�)E*c��UOoUOePoL&UO[O2*
oUOU2vq4U%f)UO]6�cUOQ2[gV41!)Nzidle iterator exhausted)	rvrtrurPr~r�rWr��
StopIteration)rjryrmr�r<s&    r>�__next__�Idler.__next__�sh���z�z���>�>�!��G��n�n�t�~�~�'7�7�G��I�I�g�&�	���!�Z�Z�1�_��
�
�4�5����y�r6c#� �UOO%fUOOQ2g[U2w�UOUP29o%cUw�	J!P![cP!h9h3h)aEYield a burst of responses no more than 'interval' seconds apart.

with M.idle() as idler:
    # get a response and any others following by < 0.1 seconds
    batch = list(idler.burst())
    print(f'processing {len(batch)} responses...')
    print(batch)

Note: This generator requires a socket connection (not IMAP4_stream).
z$burst() requires a socket connection)rvr�rJ�nextr�r�)rj�intervalrs&& r>�burst�Idler.burst�sn����z�z�����*�*�"�"�#I�J�J�	��t�*���)�)�H�d�3�3�h�3��N�4���	��	�s9�A?�A?�A-�
A?�$	A?�-	A<�7A<�8A?�;A<�<A?)rurtrvrxrwr�))riN)g�������?)rErFrGrHrkrnr�r�r�r�r�r�rIrorps@r>r\r\s5�����
!�)�V$�L�0�d� �r6r\c�V`�\sQsQsnQsP\1QPQP-QkksQsP\P1QksQs	Us
P!)	�	IMAP4_SSLi�a?IMAP4 client class over SSL connection

Instantiate with: IMAP4_SSL([host[, port[, ssl_context[, timeout=None]]]])

        host - host's name (default: localhost);
        port - port number (default: standard IMAP4 SSL port);
        ssl_context - a SSLContext object that contains your certificate chain
                      and private key (default: None)
        timeout - socket timeout (default: None) If timeout is not given or is None,
                  the global default socket timeout is used

for more documentation see the docstring of the parent class IMAP4.
r�rmc�r�Ue[O2oV0m[O	VV$2P!r�)r�r�r�rrn)rjrkrlr�rms&&&$$r>rn�IMAP4_SSL.__init__�s*���"�!�8�8�:��*���N�N�4�t�5r6c�|�[OV2oUOOUUOQ5!)r�)rr�r�r�rk)rjrmr�s&& r>r��IMAP4_SSL._create_socket�s;���'�'��6�D��#�#�/�/��@D�	�	�0�K�
Kr6c�4�[OVV#2P!)z�Setup connection to remote server on "host:port".
    (default: localhost:standard IMAP4 SSL port).
This connection will be used by the routines:
    read, readline, send, shutdown.
)rrdris&&&&r>rd�IMAP4_SSL.open�s��
�J�J�t�4�1r6)r�)rErFrGrHrk�IMAP4_SSL_PORTrnr�rdrIrorps@r>r�r��s?����	�!#��	6�$(�	6�26�	6�	K�
�^�T�	2�	2r6r�c�N`�\sQsQsnQsQsQ
QksQsQsQs	Qs
Q	sUsP!)ri�z�IMAP4 client class over a stream

Instantiate with: IMAP4_stream(command)

        "command" - a string that can be passed to subprocess.Popen()

for more documentation see the docstring of the parent class IMAP4.
c�>�Vm[OU2P!r�)r�rrn)rjr�s&&r>rn�IMAP4_stream.__init__s����
���t�r6c	�B�PUmPUmPUmPUm[O
UO[[O[OP	P	Q5Um	UOOUmUOOUm
P!)zmSetup a stream connection.
This connection will be used by the routines:
    read, readline, send, shutdown.
)�bufsize�stdin�stdout�shell�	close_fds)rkrlr�r��
subprocess�Popenr�r�PIPErr��	writefiler��readfileris&&&&r>rd�IMAP4_stream.open
sr��
��	���	���	�!���!�'�'����'��/�/�*�/�/��$�(������+�+������+�+��
r6c�:�UOOU2!)r�)r�r�)rjr�s&&r>r��IMAP4_stream.reads���}�}�!�!�$�'�'r6c�8�UOO2!)r�)r�r�r{s&r>r��IMAP4_stream.readlines���}�}�%�%�'�'r6c�r�UOOU2UOO2P!)r�)r�rTrUr�s&&r>r��IMAP4_stream.send$s$�������T�"������r6c��UOO2UOO2UOO	2P!)r�)r�r�r�r�waitr{s&r>rg�IMAP4_stream.shutdown*s2���
�
���������������r6)r�r�rkrlrr�r�r�)NNN)
rErFrGrHrkrnrdr�r�r�rgrIrorps@r>rr�s-������
,� (�
(�
��r6c�>`�\sQsQsnQsQsQsQsQsQs	Us
P!)ri2zSPrivate class to provide en/decoding
for base64-based authentication conversation.
c��VmP!r��r)rj�mechinsts&&r>rn�_Authenticator.__init__8s���	r6c�r�UOUOU22oUeQ!UOU2!)N�*)rr�ry)rjr<�rets&& r>r�_Authenticator.process;s0���i�i����D�)�*���;���{�{�3��r6c��Qo[U[2%cUOQ2oU%cU[U2]06�cUQ*oUQ*oLSoQo[O
U2oU%fJOV$PP*oJ\U!)r6r~:N�0N:r�NN)rwrxryr��binascii�
b2a_base64)rj�inp�oup�t�es&&   r>ry�_Authenticator.encodeAsu�����c�3����*�*�W�%�C���3�x�"�}���H���#�h�������#�#�A�&�A��q��c�r�F�l���
r6c�D�U%fQ![OU2!)r6)r��
a2b_base64)rjr�s&&r>r��_Authenticator.decodeYs�����"�"�3�'�'r6r�)rErFrGrHrkrnrryr�rIrorps@r>rr2s#������ ��0(�(r6rz0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decru:rNNc	��[OU2oU%fP![UOQ2*oUOQ2o[	UOQ22o[	UOQ22o[	UOQ22o[	UOQ22o[	UOQ22o[	UOQ22o	[	UOQ	22o
U	]<*U
*]<*oUQ
6XcU'oVRVFVxPPP1	o[
OU2U*
o
[OU
2!)z�Parse an IMAP4 INTERNALDATE string.

Return corresponding local time.  The return value is a
time.struct_time tuple or None if the string has wrong format.
�mon�zonen�day�year�hour�min�sec�zoneh�zonem�-)	�InternalDater)�Mon2numrr�calendar�timegmrPrR)rr�r�r�r�r�r�r�r�r�r��zone�tt�utcs&             r>�Internaldate2tupler�as��
�	�	�D�	!�B�
��
�"�(�(�5�/�
"�C��H�H�W��E�

�b�h�h�u�o�
�C��r�x�x��� �D��r�x�x��� �D�

�b�h�h�u�o�
�C�

�b�h�h�u�o�
�C������!�"�E������!�"�E�
�"�H�u��b� �D���}��u��
�S��"�b�"�	5�B�
�/�/�"�
��
$�C��>�>�#��r6c��QoQo[[U22oU%c#[U]2vqV#U]*U*oJ*U!)z-Convert integer to A-P string representation.r6sABCDEFGHIJKLMNOP)r�abs�divmod)�numr��AP�mods&   r>r�r��sB���C�'�r�

�c�#�h�-�C�

��#�r�?����S��U�m�c�!���Jr6c��[OU2oU%fQ![UOQ2O	22!)z-Convert IMAP4 flags response to python tuple.r
rC)�Flagsr)rrr)rr�s& r>�
ParseFlagsr��s7��
���T�	�B�
��	�����'�"�(�(�*�+�+r6c��[U[[12%c6[OU[
O2O2oCLM[U[2%c�[UQP2oUe�[O%ckU]*oUP6Xc2[O[OU22]*o[O
[O1U*'oL[O
'o[UQ5o[UQ*Q[U2-oLl[U[2%cUO e[#Q2gSoL:[U[$2%cU]*UP*1Q6XcU![#Q2gQO'[(UO**2oUO-U2!)	a�Convert date_time to IMAP4 INTERNALDATE representation.

Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
date_time argument can be a number (int or float) representing
seconds since epoch (as returned by time.time()), a 9-tuple
representing local time, an instance of time.struct_time (as
returned by time.localtime()), an aware datetime instance or a
double-quoted string.  In the last case, it is assumed to already
be in the correct format.
�	tm_gmtoff)�seconds:N�N�tzinfozdate_time must be awarezdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")�"r�)rwrr�r�
fromtimestamprr��
astimezonerr�rP�daylightrR�mktime�altzonerr�r�rx�format�Months�monthrQ)r�dt�gmtoff�dst�delta�fmts&     r>rr�sX���)�c�5�\�*�*�
�
#�
#�I�$,�L�L�2�2<�*�,�	�	�I�u�	%�	%���K��6���>��}�}�}���l���"�9��.�.����Y�)?�@��C�C��=�=�$�,�,�7��<�<���-�-����&�)��
�y��}�
=�X�e�_�
=��	�I�x�	(�	(����#��6�7�7�
��	�I�s�	#�	#��1��i��m�(D�	�(Q����8�9�9�
"�
)�
)�&����*:�
;�C�
�;�;�s��r6�__main__zd:s:z-dz-szIMAP password for z on �	localhostr[zJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)srk�lf�
rm�
/tmp/yyz 2r�rfr�c���[OU8QU802[[U2Uvq#[OU8QU8QU802UQ6Xc
U]*gU!)rurr�)�Mr�r�)�cmdr�r�r�s&&  r>�runr�sL��	���3��%�&��1�c�?�D�)���	����c�3�/�0��$�;�c�!�f���
r6zPROTOCOL_VERSION = %szCAPABILITIES = z.*"([^"]+)"$r3z%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
c�d�UQ6Xc]QHGoUQQQ5Q![Q[8QU802g)�__version__)r�r�z2.60zmodule z has no attribute )r��)r�r�r�rE)r�r�s& r>r�r�/s3���}��(��M�'�2��
�7�8�,�.@���I�
J�Jr6)rrr�r�r�r)�	IMAP4REV1r)r
r�)r�)r�r
r�r
)r�)r
)r�rC)ri)r/)�
/tmp/xxx 1)r�)rz/tmp/yyy)r�r)rf)z/tmpzyy*)r�r
)r�)N�SUBJECT�test)rB)�1z(FLAGS INTERNALDATE RFC822))r�)r�FLAGSz
(\Deleted))r�rC)r=rC)r�rC)r�rC)r�rC)r)�UIDVALIDITY)r�)r'r<)r)r�)r�rC)z/tmp/zyy%)\rkr�r�r�rtr�r�r�rPr�rrr�iorr�r��ImportError�__all__r	rVrlr�r�r�r�rurr�r�rwrxrrrrzrvryr�rFrIr9r?rr\r�r�rrrr��	enumerateryr�r�r�r�rrE�getopt�getpass�argv�optlistr�rJ�stream_command�optr�rrk�getuser�USER�PASSWD�	test_mesg�	test_seq1�	test_seq2rrrXr�r�r�r�mlr)r�r�pathr�r��printr�)rgr,s00r>�<module>r&s���
�.L�K�K�K�K�2�2�"����H�8��
��	��
�
���(����
-
��,�-
�	��-
�	�A�	-
�
	�
�-
�	�
�
-
�	�
�-
�	�,�-
�	�,�-
�	�,�-
�	�
�-
�	�,�-
�	�
�-
�	�
�-
�	�,�-
� 	�,�!-
�"	�,�#-
�$	�,�%-
�&	�,�'-
�(	�,�)-
�*	�,�+-
�,	��--
�.	�A�/-
�0	�,�1-
�2	�
�3-
�4	�,�5-
�6	�A�7-
�8	�
�9-
�:	�	�;-
�<	�,�=-
�>	�
�?-
�@	�,�A-
�B	�,�C-
�D	�,�E-
�F	�,�G-
�H	�
����,��
��,��
�
�
��,��
�Y-
��b�z�z�0�1��
�
�
�4�5���z�z����
�*�*�+�R�X�X�
6��
�*�*�^�
$���
�
�D�E�
��J�J�G�H���*�*�;�R�X�X�G��"��J�����M�*���J�J�@�A�����;�<��
�*�*�+�
,��7�y�y�x+~�~�B�#2�E�#2�J�N�N�;��5�5�5�r*(�*(�X
<�	A�	A�#�	F��&/��r�
�&;�
<�&;�d�a�1�8�8�:�a��c�>�&;�
<���F	�,�$�P�z�����
�
�c�h�h�r�l�F�;�
����N����C��$�;���H�E�
�D�[� �N��4�� 1��������7�D��?�?��D�
�_�_�t�T�EX�EX�[�EX�Y�
Z�F�\�`f�gk�mq�rv�_w�w�I��t�V�n���*��
��d�D�)�4�5���)�3�,������I�$�!���
��d�D�)�,�-����I��)���^�,�A��d��A��7�7�f��!�"�
�I�	���'�!�*<�*<�<�=�	���q�~�~�7�8�!�H�C����T�N�"��f�.�/�B����/�2�.�B��"�(�(�1�+�4�����B��$���4�'�"�	0�"�H�C���c�4�.�C��D�z�7�7���b�'�-�-�/�C��������B���P�R�
S�"�	�� �K��a@���H���@:=��^�<�<���B�
�����j	�
�� ����
�h�h�q�k��
�
	�sg�R-�3%R=�9'S�S �#!S �BS �
AS � S �(S �-R:�3R:�9R:�S�S�S� T�2!T

Youez - 2016 - github.com/yon3zu
LinuXploit