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.141.198.110
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : imaplib.cpython-32.pyo
l
��bc&@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZyddl
Z
eZWnek
r�eZYnXddddd	d
gZdZdZdZd
ZddfZdZi'ddfd6dfd6ddddfd6dfd6dfd6dfd6ddfd6ddfd6ddfd6ddfd6dfd6dfd6ddfd 6ddfd!6ddfd"6ddfd#6ddfd$6ddfd%6dfd&6ddddfd6ddfd'6ddfd(6ddddfd)6dfd*6dfd+6ddfd,6dfd-6ddfd.6ddfd/6ddfd06ddfd16dfd26dfd36ddfd46dfd56ddfd66dfd76dfd86ddfd96Zejd:�Zejd;�Zejd<�Zejd=ej�Zejd>�Z ejd?�Z!ejd@�Z"ejdAej�Z#GdB�d�Z$er�GdC�dDe$�Z%ej&dD�nGdE�de$�Z'GdF�dG�Z(idHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6Z)d`�Z*da�Z+db�Z,dc�Z-e.ddkr~ddl/Z/ddl0Z0y)e/j/ej1dHd�de�\Z2Z3Wn:e/j4k
r�Z5zfff\Z2Z3WYddZ5[5XnXe6Z7xWe2D]O\Z8Z5e8dfkr�e9e5�Zn(e8dgkr%e5Z7e3r"e7fZ3nnq�We3r<dhfZ3ne3dZ:e0j;�Z<e0j0die<e:pgdjf�Z=dkie<dl6dmdn6Z>doe<e=ffdpdqffdrdqdsffddtffdudte6e6e>ffdvdwdxffdydtffdze6d{d|ffd}d~dffd�d~d�d�ffd�ffd�ffd�ffd�fffZ?dyffd�d�ffd�d-d�ffd�d�ffdue6e6e6e>ffd�ffd�fffZ@d��ZAy�e7r�e'e7�ZBne$e:�ZBeBjCdkr�e?dHd�Z?neBjDd�eBjE�eBjDd�eBjFf�x!e?D]\ZGZ3eAeGe3�q*WxheAdvd�d�f�D]QZHejId�eH�ZJeJr�eJjKdH�ZLneHjM�dHZLeAd�eLf�q]Wx�e@D]|\ZGZ3eAeGe3�ZNeGe3fd�d-d�ffkr�q�neNdHjM�ZOeOrq�neAd�dd�eOdHd�f�q�WePd��Wn4ePd��ersePd�ej1d�n�YnXndS(�u�IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
u2.58iN(uDEFAULT_BUFFER_SIZEuIMAP4uIMAP4_streamuInternaldate2tupleuInt2APu
ParseFlagsuTime2Internaldates
i�i�u	IMAP4REV1i'uAUTHuSELECTEDuAPPENDuNONAUTHuAUTHENTICATEuLOGOUTu
CAPABILITYuCHECKuCLOSEuCOPYuCREATEuDELETEu	DELETEACLuEXAMINEuEXPUNGEuFETCHuGETACLu
GETANNOTATIONuGETQUOTAuGETQUOTAROOTuMYRIGHTSuLISTuLOGINuLSUBu	NAMESPACEuNOOPuPARTIALu	PROXYAUTHuRENAMEuSEARCHuSELECTuSETACLu
SETANNOTATIONuSETQUOTAuSORTuSTARTTLSuSTATUSuSTOREu	SUBSCRIBEuTHREADuUIDuUNSUBSCRIBEs\+( (?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>.*))?cBs�|EeZdZGd�de�ZGd�de�ZGd�de�Zded�Zd	�Z	d
�Z
d�Zded�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Z d!�Z!d"�Z"d#d$d%�Z#d&�Z$d'�Z%d(�Z&d)�Z'd#d$d*�Z(d+�Z)d,�Z*d-�Z+d.�Z,d/�Z-d0�Z.d1�Z/d2dNd3�Z1d4�Z2d5�Z3d6�Z4d7�Z5dMd8�Z7d9�Z8d:�Z9d;�Z:d<�Z;d=�Z<d>�Z=d?�Z>d@�Z?dA�Z@dB�ZAdC�ZBdD�ZCdE�ZDdF�ZEdG�ZFdH�ZGdI�ZHdJ�ZIdK�ZJdL�ZKdMS(Ou�IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    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.
    cBs|EeZdS(N(u__name__u
__module__(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuerror�s
uerrorcBs|EeZdS(N(u__name__u
__module__(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuabort�s
uabortcBs|EeZdS(N(u__name__u
__module__(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyureadonly�s
ureadonlyucCs�t|_d|_d|_i|_i|_d|_d|_	d|_
d|_|j||�y|j
�Wn;tk
r�y|j�Wntjk
r�YnX�YnXdS(NuLOGOUTuiF(uDebugudebugustateuNoneuliteralutagged_commandsuuntagged_responsesucontinuation_responseuFalseuis_readonlyutagnumu_tls_establisheduopenu_connectu	Exceptionushutdownusocketuerror(uselfuhostuport((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu__init__�s$									
cCs�ttjdd��|_tjd|jdtj�|_|j�|_	d|j
krhd|_n-d|j
kr�d|_n|j|j	��|j
�x-tD]%}||jkr�q�n||_dSW|jd	��dS(
Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)uPREAUTHuAUTHuOKuNONAUTHuserver not IMAP4 compliant(uInt2APurandomurandintutagpreureucompileuASCIIutagreu
_get_responseuwelcomeuuntagged_responsesustateuerroru_get_capabilitiesuAllowedVersionsucapabilitiesuPROTOCOL_VERSION(uselfuversion((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_connect�s 


	cCs3|tkrt||j��Std|��dS(NuUnknown IMAP4 command: '%s'(uCommandsugetattruloweruAttributeError(uselfuattr((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu__getattr__�scCstj|j|jf�S(N(usocketucreate_connectionuhostuport(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_create_socket�scCs:||_||_|j�|_|jjd�|_dS(u�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.
        urbN(uhostuportu_create_socketusockumakefileufile(uselfuhostuport((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuopen�s		cCsrg}d}xV||krd|jjt||d��}|sDPn|t|�7}|j|�qWdj|�S(uRead 'size' bytes from remote.iis(ufileureaduminulenuappendujoin(uselfusizeuchunksureadudata((u./usr/local/python-3.2/lib/python3.2/imaplib.pyureadscCsB|jjtd�}t|�tkr>|jdt��n|S(uRead line from remote.iugot more than %d bytes(ufileureadlineu_MAXLINEulenuerror(uselfuline((u./usr/local/python-3.2/lib/python3.2/imaplib.pyureadlinescCs|jj|�dS(uSend data to remote.N(usockusendall(uselfudata((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusendscCs�|jj�z^y|jjtj�Wn@tjk
ri}z|jtjkrW�nWYdd}~XnXWd|jj�XdS(u Close I/O established in "open".N(	ufileucloseusockushutdownusocketu	SHUT_RDWRuerroruerrnouENOTCONN(uselfue((u./usr/local/python-3.2/lib/python3.2/imaplib.pyushutdowns
cCs|jS(ufReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        (usock(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusocket+scCs]d}|jddg|�\}}|dr8||fS|j�\}}|j|||�S(uReturn 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.
        uRECENTuOKiNi����(u_untagged_responseuNoneunoop(uselfunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyurecent7s	

cCs|j|dg|j��S(u�Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N(u_untagged_responseuNoneuupper(uselfucode((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuresponseHscCs�d}|sd}n|rE|d|dfd	krKd|}qKnd
}|r`t|�}nd
}tjt|�|_|j||||�S(u�Append message to named mailbox.

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

                All args except `message' can be None.
        uAPPENDuINBOXiiu(u)u(%s)i����(u(u)N(uNoneuTime2InternaldateuMapCRLFusubuCRLFuliteralu_simple_command(uselfumailboxuflagsu	date_timeumessageuname((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuappendVs	cCsk|j�}t|�j|_|jd|�\}}|dkrX|j|d��nd|_||fS(usAuthenticate 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.
        uAUTHENTICATEuOKiuAUTHi����(uupperu_Authenticatoruprocessuliteralu_simple_commanduerrorustate(uselfu	mechanismu
authobjectumechutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuauthenticatems	cCs.d}|j|�\}}|j|||�S(uT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.u
CAPABILITY(u_simple_commandu_untagged_response(uselfunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
capability�scCs
|jd�S(uRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        uCHECK(u_simple_command(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyucheck�scCs0z|jd�\}}Wdd|_X||fS(u�Close currently selected mailbox.

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

        (typ, [data]) = <instance>.close()
        uCLOSENuAUTH(u_simple_commandustate(uselfutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuclose�s
cCs|jd||�S(u�Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        uCOPY(u_simple_command(uselfumessage_setunew_mailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyucopy�scCs|jd|�S(uPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        uCREATE(u_simple_command(uselfumailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyucreate�scCs|jd|�S(uPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        uDELETE(u_simple_command(uselfumailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyudelete�scCs|jd||�S(u�Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        u	DELETEACL(u_simple_command(uselfumailboxuwho((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	deleteacl�scCs.d}|j|�\}}|j|||�S(u�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.
        uEXPUNGE(u_simple_commandu_untagged_response(uselfunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuexpunge�s	cCs4d}|j|||�\}}|j|||�S(u#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.
        uFETCH(u_simple_commandu_untagged_response(uselfumessage_setu
message_partsunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyufetch�s
cCs+|jd|�\}}|j||d�S(uXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        uGETACLuACL(u_simple_commandu_untagged_response(uselfumailboxutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyugetacl�scCs1|jd|||�\}}|j||d�S(ua(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.u
GETANNOTATIONu
ANNOTATION(u_simple_commandu_untagged_response(uselfumailboxuentryu	attributeutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
getannotation�scCs+|jd|�\}}|j||d�S(u�Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        uGETQUOTAuQUOTA(u_simple_commandu_untagged_response(uselfurootutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyugetquota�scCs^|jd|�\}}|j||d�\}}|j||d�\}}|||gfS(u�Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        uGETQUOTAROOTuQUOTAu	QUOTAROOT(u_simple_commandu_untagged_response(uselfumailboxutypudatuquotau	quotaroot((u./usr/local/python-3.2/lib/python3.2/imaplib.pyugetquotarootsu""u*cCs4d}|j|||�\}}|j|||�S(u�List mailbox names in directory matching pattern.

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

        'data' is list of LIST responses.
        uLIST(u_simple_commandu_untagged_response(uselfu	directoryupatternunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyulistscCsY|jd||j|��\}}|dkrF|j|d��nd|_||fS(u�Identify client using plaintext password.

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

        NB: 'password' will be quoted.
        uLOGINuOKiuAUTHi����(u_simple_commandu_quoteuerrorustate(uselfuuserupasswordutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyulogins
$	cCs&|||_|_|jd|j�S(ur Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        uCRAM-MD5(uuserupassworduauthenticateu_CRAM_MD5_AUTH(uselfuuserupassword((u./usr/local/python-3.2/lib/python3.2/imaplib.pyulogin_cram_md5&scCsZddl}t|jt�r0|jjd�n|j}|jd|j||�j�S(u1 Authobject to use with CRAM-MD5 authentication. iNuASCIIu (uhmacu
isinstanceupasswordustruencodeuuseruHMACu	hexdigest(uselfu	challengeuhmacupwd((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_CRAM_MD5_AUTH/s$	cCs�d|_y|jd�\}}Wn,ddtj�dd�g}}YnX|j�d|jkr{d|jdfS||fS(u|Shutdown connection to server.

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

        Returns server 'BYE' response.
        uLOGOUTuNOu%s: %sNiuBYE(ustateu_simple_commandusysuexc_infoushutdownuuntagged_responses(uselfutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyulogout7s	)
cCs4d}|j|||�\}}|j|||�S(u�List 'subscribed' mailbox names in directory matching pattern.

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

        'data' are tuples of message part envelope and data.
        uLSUB(u_simple_commandu_untagged_response(uselfu	directoryupatternunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyulsubGscCs+|jd|�\}}|j||d�S(u�Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        uMYRIGHTS(u_simple_commandu_untagged_response(uselfumailboxutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyumyrightsRscCs.d}|j|�\}}|j|||�S(ub Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        u	NAMESPACE(u_simple_commandu_untagged_response(uselfunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	namespaceZscCs
|jd�S(uFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        uNOOP(u_simple_command(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyunoopdscCs:d}|j|||||�\}}|j||d�S(u�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.
        uPARTIALuFETCH(u_simple_commandu_untagged_response(uselfumessage_numumessage_partustartulengthunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyupartialos!cCsd}|jd|�S(u�Assume authentication as "user".

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

        (typ, [data]) = <instance>.proxyauth(user)
        u	PROXYAUTH(u_simple_command(uselfuuseruname((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	proxyauth{s	cCs|jd||�S(ukRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        uRENAME(u_simple_command(uselfu
oldmailboxu
newmailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyurename�scGsXd}|r-|j|d||�\}}n|j||�\}}|j|||�S(u�Search mailbox for matching messages.

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

        'data' is space separated list of matching message numbers.
        uSEARCHuCHARSET(u_simple_commandu_untagged_response(uselfucharsetucriteriaunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusearch�s
!uINBOXcCs�i|_||_|r!d}nd}|j||�\}}|dkr^d|_||fSd|_d|jkr�|r�|jd|��n||jjdd	g�fS(
utSelect 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.
        uEXAMINEuSELECTuOKuAUTHuSELECTEDu	READ-ONLYu%s is not writableuEXISTSN(uuntagged_responsesuis_readonlyu_simple_commandustateureadonlyugetuNone(uselfumailboxureadonlyunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuselect�s				
	cCs|jd|||�S(uZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        uSETACL(u_simple_command(uselfumailboxuwhouwhat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusetacl�scGs+|jd|�\}}|j||d�S(u_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.u
SETANNOTATIONu
ANNOTATION(u_simple_commandu_untagged_response(uselfuargsutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
setannotation�scCs.|jd||�\}}|j||d�S(uiSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        uSETQUOTAuQUOTA(u_simple_commandu_untagged_response(uselfurootulimitsutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusetquota�scGs^d}|d|dfdkr-d|}n|j||||�\}}|j|||�S(	u�IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        uSORTiiu(u)u(%s)i����(u(u)(u_simple_commandu_untagged_response(uselfu
sort_criteriaucharsetusearch_criteriaunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusort�s

cCsd}ts|jd��n|jr9|jd��n||jkrZ|jd��n|dkr�tjtj�}|j	tj
O_	n|j|�\}}|dkr�|j|j
�|_
|j
jd�|_d|_|j�n|jd��|j|||�S(	NuSTARTTLSuSSL support missinguTLS session already establisheduTLS not supported by serveruOKurbuCouldn't establish TLS sessionT(uHAVE_SSLuerroru_tls_establisheduabortucapabilitiesuNoneusslu
SSLContextuPROTOCOL_SSLv23uoptionsuOP_NO_SSLv2u_simple_commanduwrap_socketusockumakefileufileuTrueu_get_capabilitiesu_untagged_response(uselfussl_contextunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyustarttls�s$		
cCs4d}|j|||�\}}|j|||�S(upRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        uSTATUS(u_simple_commandu_untagged_response(uselfumailboxunamesunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyustatus�scCsX|d|dfd	kr'd|}n|jd|||�\}}|j||d�S(
u�Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        iiu(u)u(%s)uSTOREuFETCHi����(u(u)(u_simple_commandu_untagged_response(uselfumessage_setucommanduflagsutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyustore
s
cCs|jd|�S(uYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        u	SUBSCRIBE(u_simple_command(uselfumailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	subscribescGs7d}|j||||�\}}|j|||�S(u�IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        uTHREAD(u_simple_commandu_untagged_response(uselfuthreading_algorithmucharsetusearch_criteriaunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuthreadscGs�|j�}|tkr.|jd|��n|jt|krp|jd||jdjt|�f��nd}|j|||�\}}|d	kr�|}nd}|j|||�S(
u�Execute "command arg ..." with messages identified by UID,
                rather than message number.

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

        Returns response appropriate to 'command'.
        uUnknown IMAP4 UID command: %su9command %s illegal in state %s, only allowed in states %su, uUIDuSEARCHuSORTuTHREADuFETCH(uSEARCHuSORTuTHREAD(uupperuCommandsuerrorustateujoinu_simple_commandu_untagged_response(uselfucommanduargsunameutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuuid's			cCs|jd|�S(u_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        uUNSUBSCRIBE(u_simple_command(uselfumailbox((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuunsubscribe@scGs;|j�}|tkr+|jft|<n|j||�S(uAllow 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'.
        (uupperuCommandsustateu_simple_command(uselfunameuargs((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuxatomHs
cCsO|dkrd}n|j}||kr>||j|�n
|g||<dS(Ns(uNoneuuntagged_responsesuappend(uselfutypudatuur((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_append_untagged^s		cCs>|jjd�}|r:|j|djdd���ndS(NuBYEiuasciiureplacei����(uuntagged_responsesugetuabortudecode(uselfubye((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
_check_byelsc
Gs�|jt|krKd|_|jd||jdjt|�f��nx*dD]"}||jkrR|j|=qRqRWd|jkr�|jr�|jd��n|j	�}t
|d�}|d	|}xO|D]G}|dkr�q�nt|t�rt
|d�}n|d	|}q�W|j}|dk	r�d|_t
|�t
|j�kr`|}q�d}|t
d
t|�d�}ny|j|t�WnAtjtfk
r�}	z|jd|	��WYdd}	~	XnX|dkr�|Sx�x!|j�r|j|r�|Sq�W|r.||j�}ny|j|�|jt�WnAtjtfk
r�}	z|jd|	��WYdd}	~	XnX|s�Pq�q�|S(
Nu9command %s illegal in state %s, only allowed in states %su, uOKuNOuBADu	READ-ONLYu#mailbox status changed to READ-ONLYuASCIIs u {%s}usocket error: %s(uOKuNOuBAD(ustateuCommandsuNoneuliteraluerrorujoinuuntagged_responsesuis_readonlyureadonlyu_new_tagubytesu
isinstanceustrutypeu_commandulenusenduCRLFusocketuOSErroruabortu
_get_responseutagged_commandsucontinuation_response(
uselfunameuargsutyputagudatauarguliteralu	literatoruval((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_commandrs^			


			 &

&cCs|dkr|j�ny|j|�\}}Wn�|jk
ru}z|jd||f��WYdd}~XnA|jk
r�}z|jd||f��WYdd}~XnX|dkr�|j�n|dkr�|jd|||f��n||fS(NuLOGOUTucommand: %s => %suBADu%s command error: %s %s(u
_check_byeu_get_tagged_responseuabortuerror(uselfunameutagutypudatauval((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_command_complete�s
+,
cCsk|j�\}}|dgkr3|jd��nt|dd�}|j�}t|j��|_dS(Nu"no CAPABILITY response from serveriuASCIIi����(u
capabilityuNoneuerrorustruupperutupleusplitucapabilities(uselfutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_get_capabilities�scCsi|j�}|j|j|�r�|jjd�}||jkrX|jd|��n|jjd�}t|d�}|jjd�}||gf|j|<ncd}|jt	|�s�|jt
|�r�|jjd�}q�n|jdkr6|jt|�r |jjd�|_dS|jd|��n|jjd�}t|d�}|jjd�}|dkr~d	}n|r�|d
|}nx_|jt
|�r�t|jjd��}|j|�}|j|||f�|j�}q�W|j||�|dkre|jt|�re|jjd�}t|d�}|j||jjd��n|S(Nutaguunexpected tagged response: %sutypeuASCIIudataudata2uunexpected response: '%s'uasciiss usizeuOKuNOuBAD(uOKuNOuBAD(u	_get_lineu_matchutagreumougrouputagged_commandsuabortustruNoneuUntagged_responseuUntagged_statusuContinuationucontinuation_responseuLiteraluintureadu_append_untaggedu
Response_code(uselfuresputagutypudatudat2usizeudata((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
_get_response�sH	cCsmxf|j|}|dk	r*|j|=|Sy|j�Wq|jk
re}z�WYdd}~XqXqdS(N(utagged_commandsuNoneu
_get_responseuabort(uselfutaguresultuval((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_get_tagged_response)s

cCsY|j�}|s$|jd��n|jd�sE|jd��n|dd�}|S(Nusocket error: EOFs
usocket error: unterminated lineii����(ureadlineuabortuendswith(uselfuline((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	_get_line?scCs|j|�|_|jdk	S(N(umatchumouNone(uselfucreus((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_matchRscCs@|jtt|j�d�}|jd|_d|j|<|S(NuASCIIi(utagpreubytesustrutagnumuNoneutagged_commands(uselfutag((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_new_tag^s
cCs0|jdd�}|jdd�}d|dS(Nu\u\\u"u\"(ureplace(uselfuarg((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_quotefscGs|j||j||��S(N(u_command_completeu_command(uselfunameuargs((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_simple_commandnscCsN|dkr||fS||jkr2|dgfS|jj|�}||fS(NuNO(uuntagged_responsesuNoneupop(uselfutypudatunameudata((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_untagged_responsess

NF(Lu__name__u
__module__u__doc__u	Exceptionuerroruabortureadonlyu
IMAP4_PORTu__init__u_connectu__getattr__u_create_socketuopenureadureadlineusendushutdownusocketurecenturesponseuappenduauthenticateu
capabilityucheckucloseucopyucreateudeleteu	deleteacluexpungeufetchugetaclu
getannotationugetquotaugetquotarootulistuloginulogin_cram_md5u_CRAM_MD5_AUTHulogoutulsubumyrightsu	namespaceunoopupartialu	proxyauthurenameusearchuFalseuselectusetaclu
setannotationusetquotausortuNoneustarttlsustatusustoreu	subscribeuthreaduuiduunsubscribeuxatomu_append_untaggedu
_check_byeu_commandu_command_completeu_get_capabilitiesu
_get_responseu_get_tagged_responseu	_get_lineu_matchu_new_tagu_quoteu_simple_commandu_untagged_response(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuIMAP4us�
,	*			
			
																											
			
		 									
						M				P							cBsA|EeZdZdeddd�Zd�Zded�ZdS(u�IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port).
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);

        for more documentation see the docstring of the parent class IMAP4.
        ucCs)||_||_tj|||�dS(N(ukeyfileucertfileuIMAP4u__init__(uselfuhostuportukeyfileucertfile((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu__init__�s		cCs(tj|�}tj||j|j�S(N(uIMAP4u_create_socketussluwrap_socketukeyfileucertfile(uselfusock((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_create_socket�scCstj|||�dS(u�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.
            N(uIMAP4uopen(uselfuhostuport((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuopen�sN(u__name__u
__module__u__doc__uIMAP4_SSL_PORTuNoneu__init__u_create_socketuopen(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu	IMAP4_SSL�s
	u	IMAP4_SSLcBsP|EeZdZd�Zddd�Zd�Zd�Zd�Zd�Z	dS(u�IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

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

    for more documentation see the docstring of the parent class IMAP4.
    cCs||_tj|�dS(N(ucommanduIMAP4u__init__(uselfucommand((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu__init__�s	cCsd|_d|_d|_d|_tj|jdtdtj	dtj	dddd�|_|jj|_
|jj|_dS(u�Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        ubufsizeustdinustdoutushellu	close_fdsNT(uNoneuhostuportusockufileu
subprocessuPopenucommanduDEFAULT_BUFFER_SIZEuPIPEuTrueuprocessustdinu	writefileustdoutureadfile(uselfuhostuport((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuopen�s				cCs|jj|�S(uRead 'size' bytes from remote.(ureadfileuread(uselfusize((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuread�scCs
|jj�S(uRead line from remote.(ureadfileureadline(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyureadline�scCs!|jj|�|jj�dS(uSend data to remote.N(u	writefileuwriteuflush(uselfudata((u./usr/local/python-3.2/lib/python3.2/imaplib.pyusend�scCs+|jj�|jj�|jj�dS(u Close I/O established in "open".N(ureadfileucloseu	writefileuprocessuwait(uself((u./usr/local/python-3.2/lib/python3.2/imaplib.pyushutdown�s

N(
u__name__u
__module__u__doc__u__init__uNoneuopenureadureadlineusendushutdown(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuIMAP4_stream�s
					cBs8|EeZdZd�Zd�Zd�Zd�ZdS(ucPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dS(N(umech(uselfumechinst((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu__init__	scCs5|j|j|��}|dkr(dS|j|�S(Nu*(umechudecodeuNoneuencode(uselfudatauret((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuprocessscCs�d}t|t�r'|jd�}nxw|r�t|�dkre|dd�}|dd�}n|}d}tj|�}|r*||dd�}q*q*W|S(NsuASCIIi0ii����(u
isinstanceustruencodeulenubinasciiu
b2a_base64(uselfuinpuouputue((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuencodes		cCs|s
dStj|�S(Ns(ubinasciiu
a2b_base64(uselfuinp((u./usr/local/python-3.2/lib/python3.2/imaplib.pyudecode*sN(u__name__u
__module__u__doc__u__init__uprocessuencodeudecode(u
__locals__((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu_Authenticators

			u_AuthenticatorisJanisFebisMarisAprisMayisJunisJulisAugi	sSepi
sOctisNovisDecc	Cs7tj|�}|sd
St|jd�}|jd�}t|jd��}t|jd��}t|jd��}t|jd��}t|jd��}t|jd��}	t|jd	��}
|	d
|
d
}|dkr�|}n||||||dddf	}tj|�|}
tj	|
�S(u�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.
    umonuzonenudayuyearuhouruminusecuzonehuzonemi<s-iNi����i����i����(
uInternalDateumatchuNoneuMon2numugroupuintucalendarutimegmutimeu	localtime(urespumoumonuzonenudayuyearuhouruminusecuzonehuzonemuzoneuttuutc((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuInternaldate2tuple4s$
!cCs\d}d}tt|��}x7|rWt|d�\}}|||d�|}q!W|S(u-Convert integer to A-P string representation.ssABCDEFGHIJKLMNOPii(uintuabsudivmod(unumuvaluAPumod((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuInt2APWs	cCs2tj|�}|sdSt|jd�j��S(u-Convert IMAP4 flags response to python tuple.uflags((uFlagsumatchutupleugroupusplit(urespumo((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu
ParseFlagsdscCst|ttf�r'tj|�}nZt|ttjf�rH|}n9t|t�ru|d|dfdkru|Std��tj	d|�}|ddkr�d|dd�}ntj
r�|d
r�tj}n
tj}d|d	t
|d
d
�dS(u�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 (as returned by time.localtime()), or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    iiu"udate_time not of a known typeu%d-%b-%Y %H:%M:%Su0u Nu
 %+03d%02di<i����(u"u"i����(u
isinstanceuintufloatutimeu	localtimeutupleustruct_timeustru
ValueErrorustrftimeudaylightualtzoneutimezoneudivmod(u	date_timeuttudtuzone((u./usr/local/python-3.2/lib/python3.2/imaplib.pyuTime2Internaldateos	)

u__main__ud:s:u-du-suuIMAP password for %s on %s: u	localhostuJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)suuseru
ulfuloginucreateu
/tmp/xxx 1urenameu/tmp/yyyu
/tmp/yyz 2uappendulistu/tmpuyy*uselectusearchuSUBJECTutestufetchu1u(FLAGS INTERNALDATE RFC822)ustoreuFLAGSu
(\Deleted)u	namespaceuexpungeurecentucloseuresponseuUIDVALIDITYuuiduALLuEXISTSulogoutcCsitjd||f�tt|�|�\}}tjd|||f�|dkre|d�n|S(Nu%s %su%s => %s %suNOi(uMu_mesgugetattr(ucmduargsutypudat((u./usr/local/python-3.2/lib/python3.2/imaplib.pyurun�s
uPROTOCOL_VERSION = %suCAPABILITIES = %ru/tmp/uyy%u.*"([^"]+)"$udeleteu%su:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)u
All tests OK.u
Tests failed.u8
If you would like to see debugging output,
try: %s -d5
(Qu__doc__u__version__ubinasciiuerrnourandomureusocketu
subprocessusysutimeucalendaruiouDEFAULT_BUFFER_SIZEussluTrueuHAVE_SSLuImportErroruFalseu__all__uCRLFuDebugu
IMAP4_PORTuIMAP4_SSL_PORTuAllowedVersionsu_MAXLINEuCommandsucompileuContinuationuFlagsuInternalDateuASCIIuLiteraluMapCRLFu
Response_codeuUntagged_responseuUntagged_statusuIMAP4u	IMAP4_SSLuappenduIMAP4_streamu_AuthenticatoruMon2numuInternaldate2tupleuInt2APu
ParseFlagsuTime2Internaldateu__name__ugetoptugetpassuargvuoptlistuargsuerroruvaluNoneustream_commanduoptuintuhostugetuseruUSERuPASSWDu	test_mesgu	test_seq1u	test_seq2urunuMustateu_mesguPROTOCOL_VERSIONucapabilitiesucmdumlumatchumougroupupathusplitudatuuiduprint(((u./usr/local/python-3.2/lib/python3.2/imaplib.pyu<module>s6l

	


































����4 9.--	#	
		 )%
						

© 2025 GrazzMean