%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/imaplib.pyo


Mac@sdZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	dddddd	gZ
d
ZdZdZ
d
ZddfZdZi'ddfd6dfd6ddddfd6dfd6dfd6dfd6ddfd6ddfd6ddfd6ddfd6dfd6dfd6ddfd 6ddfd!6ddfd"6ddfd#6ddfd$6ddfd%6dfd&6ddddfd6ddfd'6dfd(6ddfd)6ddddfd*6dfd+6dfd,6ddfd-6dfd.6ddfd/6ddfd06ddfd16ddfd26dfd36ddfd46dfd56ddfd66dfd76dfd86ddfd96Zejd:Zejd;Zejd<Zejd=Zejd>Zejd?Zejd@ZejdAZdfdBYZyddlZWnek
rBn$XdCefdDYZe
jdCdefdEYZ dFfdGYZ!idHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6Z"d`Z#daZ$dbZ%dcZ&e'ddkrddl(Z(ddl)Z)y#e(j(ej*dHde\Z+Z,Wn(e(j-k
r~Z.fff\Z+Z,nXe/Z0xWe+D]O\Z1Z.e1dfkre2e.Zn(e1dgkre.Z0e,re0fZ,nnqWe,rdhfZ,ne,dZ3e)j4Z5e)j)die5e3pdjfZ6dkie5dl6dmdn6Z7doe5e6ffdpdqffdrdqdsffddtffdudte/e/e7ffdvdwdxffdydtffdze/d{d|ffd}d~dffdd~ddffdffdffdffdfffZ8dyffddffdd.dffddffdue/e/e/e7ffdffdfffZ9dZ:ye0re e0Z;nee3Z;e;j<dkre8dHZ8ne;j=de;j>e;j=de;j?fx!e8D]\Z@Z,e:e@e,qWxge:dvddfD]PZAejBdeAZCeCr=eCjDdHZEneAjFdZEe:deEfq
Wxe9D]z\Z@Z,e:e@e,ZGe@e,fdd.dffkrqhneGdjFZHeHrqhne:dddeHddfqhWdGHWn)dGHerdej*dGHnnXndS(sIMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
s2.58iNtIMAP4tIMAP4_streamtInternaldate2tupletInt2APt
ParseFlagstTime2Internaldates
iiit	IMAP4REV1i@BtAUTHtSELECTEDtAPPENDtNONAUTHtAUTHENTICATEtLOGOUTt
CAPABILITYtCHECKtCLOSEtCOPYtCREATEtDELETEt	DELETEACLtEXAMINEtEXPUNGEtFETCHtGETACLt
GETANNOTATIONtGETQUOTAtGETQUOTAROOTtMYRIGHTStLISTtLOGINtLSUBtMOVEt	NAMESPACEtNOOPtPARTIALt	PROXYAUTHtRENAMEtSEARCHtSELECTtSETACLt
SETANNOTATIONtSETQUOTAtSORTtSTATUStSTOREt	SUBSCRIBEtTHREADtUIDtUNSUBSCRIBEs\+( (?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>.*))?cBseZdZdefdYZdefdYZdefdYZejdZ	de
d	Zd
Zde
dZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!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.d/Z/d0Z0d1e1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJRS(KsIMAP4 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.
    terrorcBseZRS((t__name__t
__module__(((s#/usr/local/lib/python2.7/imaplib.pyR1stabortcBseZRS((R2R3(((s#/usr/local/lib/python2.7/imaplib.pyR4streadonlycBseZRS((R2R3(((s#/usr/local/lib/python2.7/imaplib.pyR5ss[^\w!#$%&'*+,.:;<=>?^`|~-]tcCs|t|_d|_d|_i|_i|_d|_t|_	d|_
|j||tt
jdd|_tjd|jd|_|j|_d|jkrd	|_n-d
|jkrd|_n|j|j|j\}}|dgkr|jdnt|d
jj|_x-tD]%}||jkr[q@n||_dSW|jddS(NRR6iiis(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)tPREAUTHRtOKR
s"no CAPABILITY response from serverisserver not IMAP4 compliant(tDebugtdebugtstatetNonetliteralttagged_commandstuntagged_responsestcontinuation_responsetFalsetis_readonlyttagnumtopenRtrandomtrandintttagpretretcompilettagret
_get_responsetwelcomeR1t
capabilityttupletuppertsplittcapabilitiestAllowedVersionstPROTOCOL_VERSION(tselfthosttportttyptdattversion((s#/usr/local/lib/python2.7/imaplib.pyt__init__s8								

	cCs3|tkrt||jStd|dS(NsUnknown IMAP4 command: '%s'(tCommandstgetattrtlowertAttributeError(RTtattr((s#/usr/local/lib/python2.7/imaplib.pyt__getattr__scCsC||_||_tj||f|_|jjd|_dS(sSetup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        trbN(RURVtsockettcreate_connectiontsocktmakefiletfile(RTRURV((s#/usr/local/lib/python2.7/imaplib.pyRDs		cCs|jj|S(sRead 'size' bytes from remote.(Rftread(RTtsize((s#/usr/local/lib/python2.7/imaplib.pyRgscCsB|jjtd}t|tkr>|jdtn|S(sRead line from remote.isgot more than %d bytes(Rftreadlinet_MAXLINEtlenR1(RTtline((s#/usr/local/lib/python2.7/imaplib.pyRiscCs|jj|dS(sSend data to remote.N(Rdtsendall(RTtdata((s#/usr/local/lib/python2.7/imaplib.pytsendscCst|jjzRy|jjtjWn4tjk
r]}|jtjdfkr^q^nXWd|jjXdS(s Close I/O established in "open".i&'N(	RftcloseRdtshutdownRbt	SHUT_RDWRR1terrnotENOTCONN(RTte((s#/usr/local/lib/python2.7/imaplib.pyRqs
cCs|jS(sfReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        (Rd(RT((s#/usr/local/lib/python2.7/imaplib.pyRbscCs]d}|jddg|\}}|dr8||fS|j\}}|j|||S(sReturn 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.
        tRECENTR8iN(t_untagged_responseR<tnoop(RTtnameRWRX((s#/usr/local/lib/python2.7/imaplib.pytrecent!s	

cCs|j|dg|jS(sReturn data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N(RwR<RO(RTtcode((s#/usr/local/lib/python2.7/imaplib.pytresponse2scCsd}|sd}n|rE|d|dfdkrKd|}qKnd	}|r`t|}nd	}tjt||_|j||||S(
sAppend message to named mailbox.

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

                All args except `message' can be None.
        R	tINBOXiit(t)s(%s)(R~RN(R<RtMapCRLFtsubtCRLFR=t_simple_command(RTtmailboxtflagst	date_timetmessageRy((s#/usr/local/lib/python2.7/imaplib.pytappend@s	cCsk|j}t|j|_|jd|\}}|dkrX|j|dnd|_||fS(s,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.
        It should return data that will be encoded and sent to server.
        It should return None if the client abort response '*' should
        be sent instead.
        RR8iR(ROt_AuthenticatortprocessR=RR1R;(RTt	mechanismt
authobjecttmechRWRX((s#/usr/local/lib/python2.7/imaplib.pytauthenticateWs	cCs.d}|j|\}}|j|||S(sT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.R
(RRw(RTRyRWRX((s#/usr/local/lib/python2.7/imaplib.pyRMtscCs
|jdS(sRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        R(R(RT((s#/usr/local/lib/python2.7/imaplib.pytcheck}scCs0z|jd\}}Wdd|_X||fS(sClose currently selected mailbox.

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

        (typ, [data]) = <instance>.close()
        RNR(RR;(RTRWRX((s#/usr/local/lib/python2.7/imaplib.pyRps
cCs|jd||S(sCopy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        R(R(RTtmessage_settnew_mailbox((s#/usr/local/lib/python2.7/imaplib.pytcopyscCs|jd|S(sPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        R(R(RTR((s#/usr/local/lib/python2.7/imaplib.pytcreatescCs|jd|S(sPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        R(R(RTR((s#/usr/local/lib/python2.7/imaplib.pytdeletescCs|jd||S(sDelete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        R(R(RTRtwho((s#/usr/local/lib/python2.7/imaplib.pyt	deleteaclscCs.d}|j|\}}|j|||S(sPermanently 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.
        R(RRw(RTRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytexpunges	cCs4d}|j|||\}}|j|||S(s#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(RRw(RTRt
message_partsRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytfetchs
cCs+|jd|\}}|j||dS(sXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        RtACL(RRw(RTRRWRX((s#/usr/local/lib/python2.7/imaplib.pytgetaclscCs1|jd|||\}}|j||dS(sa(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.Rt
ANNOTATION(RRw(RTRtentryt	attributeRWRX((s#/usr/local/lib/python2.7/imaplib.pyt
getannotationscCs+|jd|\}}|j||dS(sGet the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        RtQUOTA(RRw(RTtrootRWRX((s#/usr/local/lib/python2.7/imaplib.pytgetquotascCs^|jd|\}}|j||d\}}|j||d\}}|||gfS(sGet the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        RRt	QUOTAROOT(RRw(RTRRWRXtquotat	quotaroot((s#/usr/local/lib/python2.7/imaplib.pytgetquotarootss""t*cCs4d}|j|||\}}|j|||S(sList mailbox names in directory matching pattern.

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

        'data' is list of LIST responses.
        R(RRw(RTt	directorytpatternRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytlistscCsY|jd||j|\}}|dkrF|j|dnd|_||fS(sIdentify client using plaintext password.

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

        NB: 'password' will be quoted.
        RR8iR(Rt_quoteR1R;(RTtusertpasswordRWRX((s#/usr/local/lib/python2.7/imaplib.pytlogins
$	cCs&|||_|_|jd|jS(sr Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        sCRAM-MD5(RRRt_CRAM_MD5_AUTH(RTRR((s#/usr/local/lib/python2.7/imaplib.pytlogin_cram_md5scCs0ddl}|jd|j|j|jS(s1 Authobject to use with CRAM-MD5 authentication. iNt (thmacRtHMACRt	hexdigest(RTt	challengeR((s#/usr/local/lib/python2.7/imaplib.pyRscCs~d|_y|jd\}}Wn%ddtjd g}}nX|jd|jkrtd|jdfS||fS(s|Shutdown connection to server.

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

        Returns server 'BYE' response.
        RtNOs%s: %sitBYE(R;Rtsystexc_infoRqR?(RTRWRX((s#/usr/local/lib/python2.7/imaplib.pytlogouts	"
cCs4d}|j|||\}}|j|||S(sList 'subscribed' mailbox names in directory matching pattern.

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

        'data' are tuples of message part envelope and data.
        R(RRw(RTRRRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytlsub/scCs+|jd|\}}|j||dS(sShow my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        R(RRw(RTRRWRX((s#/usr/local/lib/python2.7/imaplib.pytmyrights:scCs.d}|j|\}}|j|||S(sb Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        R (RRw(RTRyRWRX((s#/usr/local/lib/python2.7/imaplib.pyt	namespaceBscCs
|jdS(sFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        R!(R(RT((s#/usr/local/lib/python2.7/imaplib.pyRxLscCs:d}|j|||||\}}|j||dS(sFetch 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"R(RRw(RTtmessage_numtmessage_parttstarttlengthRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytpartialWs!cCsd}|jd|S(sAssume authentication as "user".

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

        (typ, [data]) = <instance>.proxyauth(user)
        R#(R(RTRRy((s#/usr/local/lib/python2.7/imaplib.pyt	proxyauthcs	cCs|jd||S(skRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        R$(R(RTt
oldmailboxt
newmailbox((s#/usr/local/lib/python2.7/imaplib.pytrenamepscGsXd}|r-|j|d||\}}n|j||\}}|j|||S(sSearch mailbox for matching messages.

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

        'data' is space separated list of matching message numbers.
        R%tCHARSET(RRw(RTtcharsettcriteriaRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytsearchxs
!R}cCsi|_||_|r!d}nd}|j||\}}|dkr^d|_||fSd|_d|jkr|r|jd|n||jjdd	gfS(
stSelect 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&R8RRs	READ-ONLYs%s is not writabletEXISTSN(R?RBRR;R5tgetR<(RTRR5RyRWRX((s#/usr/local/lib/python2.7/imaplib.pytselects				
	cCs|jd|||S(sZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        R'(R(RTRRtwhat((s#/usr/local/lib/python2.7/imaplib.pytsetaclscGs+|jd|\}}|j||dS(s_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.R(R(RRw(RTtargsRWRX((s#/usr/local/lib/python2.7/imaplib.pyt
setannotationscCs.|jd||\}}|j||dS(siSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        R)R(RRw(RTRtlimitsRWRX((s#/usr/local/lib/python2.7/imaplib.pytsetquotascGs^d}|d|dfdkr-d|}n|j||||\}}|j|||S(sIMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        R*iiR~Rs(%s)(R~R(RRw(RTt
sort_criteriaRtsearch_criteriaRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytsorts

cCs4d}|j|||\}}|j|||S(spRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        R+(RRw(RTRtnamesRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytstatusscCsX|d|dfdkr'd|}n|jd|||\}}|j||dS(	sAlters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        iiR~Rs(%s)R,R(R~R(RRw(RTRtcommandRRWRX((s#/usr/local/lib/python2.7/imaplib.pytstores
cCs|jd|S(sYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        R-(R(RTR((s#/usr/local/lib/python2.7/imaplib.pyt	subscribescGs7d}|j||||\}}|j|||S(sIMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        R.(RRw(RTtthreading_algorithmRRRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytthreadscGs|j}|tkr.|jd|n|jt|krp|jd||jdjt|fnd}|j|||\}}|d	kr|}nd}|j|||S(
sExecute "command arg ..." with messages identified by UID,
                rather than message number.

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

        Returns response appropriate to 'command'.
        sUnknown IMAP4 UID command: %ss9command %s illegal in state %s, only allowed in states %ss, R/R%R*R.R(R%R*R.(ROR[R1R;tjoinRRw(RTRRRyRWRX((s#/usr/local/lib/python2.7/imaplib.pytuids			cCs|jd|S(s_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        R0(R(RTR((s#/usr/local/lib/python2.7/imaplib.pytunsubscribescGs;|j}|tkr+|jft|<n|j||S(sAllow 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'.
        (ROR[R;R(RTRyR((s#/usr/local/lib/python2.7/imaplib.pytxatoms
cCsO|dkrd}n|j}||kr>||j|n
|g||<dS(NR6(R<R?R(RTRWRXtur((s#/usr/local/lib/python2.7/imaplib.pyt_append_untagged.s		cCs2|jjd}|r.|j|dndS(NRi(R?RR4(RTtbye((s#/usr/local/lib/python2.7/imaplib.pyt
_check_bye<sc
GsZ|jt|krKd|_|jd||jdjt|fnx*dD]"}||jkrR|j|=qRqRWd|jkr|jr|jdn|j	}d||f}x9|D]1}|dkrqnd||j
|f}qW|j}|dk	r\d|_t|t|jkr=|}q\d}d	|t
|f}ny|jd
|tfWn/tjtfk
r}	|jd|	nX|dkr|Sxx!|jr|j|r|SqW|r||j}ny|j||jtWn/tjtfk
rG}	|jd|	nX|sPqqW|S(
Ns9command %s illegal in state %s, only allowed in states %ss, R8RtBADs	READ-ONLYs#mailbox status changed to READ-ONLYs%s %ss%s {%s}s%s%sssocket error: %s(R8RR(R;R[R<R=R1RR?RBR5t_new_tagt_checkquotettypet_commandRkRoRRbtOSErrorR4RKR>R@(
RTRyRRWttagRntargR=t	literatortval((s#/usr/local/lib/python2.7/imaplib.pyRBsX			


			

cCs|dkr|jny|j|\}}Wn]|jk
rc}|jd||fn/|jk
r}|jd||fnX|dkr|jn|dkr|jd|||fn||fS(NRscommand: %s => %sRs%s command error: %s %s(Rt_get_tagged_responseR4R1(RTRyRRWRnR((s#/usr/local/lib/python2.7/imaplib.pyt_command_completes

cCs6|j}|j|j|r|jjd}||jkrX|jd|n|jjd}|jjd}||gf|j|<nTd}|jt|s|jt	|r|jjd}qn|jdkr'|jt
|r|jjd|_dS|jd|n|jjd}|jjd}|dkr`d}n|rw|d|}nx_|jt|rt
|jjd	}|j|}|j|||f|j}qzW|j|||d
kr2|jt|r2|j|jjd|jjdn|S(NRsunexpected tagged response: %sRRntdata2sunexpected response: '%s'R6RRhR8RR(R8RR(t	_get_linet_matchRJtmotgroupR>R4R<tUntagged_responsetUntagged_statustContinuationR@tLiteraltintRgRt
Response_code(RTtrespRRWRXtdat2RhRn((s#/usr/local/lib/python2.7/imaplib.pyRKs@	+cCsfx_|j|}|dk	r*|j|=|S|jy|jWq|jk
r]}qXqWdS(N(R>R<RRKR4(RTRtresultR((s#/usr/local/lib/python2.7/imaplib.pyRs


cCsS|j}|s$|jdn|jdsE|jdn|d }|S(Nssocket error: EOFs
ssocket error: unterminated linei(RiR4tendswith(RTRl((s#/usr/local/lib/python2.7/imaplib.pyRs
cCs|j||_|jdk	S(N(tmatchRR<(RTtcrets((s#/usr/local/lib/python2.7/imaplib.pyRscCs7d|j|jf}|jd|_d|j|<|S(Ns%s%si(RGRCR<R>(RTR((s#/usr/local/lib/python2.7/imaplib.pyR#s
cCst|tdk	r|St|dkrR|d|dfdd	fkrR|S|rt|jj|dkrt|S|j|S(
NR6iiiR~Rt"(R~R(RR(RRkt	mustquoteRR<R(RTR((s#/usr/local/lib/python2.7/imaplib.pyR+s2cCs,|jdd}|jdd}d|S(Ns\s\\Rs\"s"%s"(treplace(RTR((s#/usr/local/lib/python2.7/imaplib.pyR9scGs|j||j||S(N(RR(RTRyR((s#/usr/local/lib/python2.7/imaplib.pyRAscCsN|dkr||fS||jkr2|dgfS|jj|}||fS(NR(R?R<tpop(RTRWRXRyRn((s#/usr/local/lib/python2.7/imaplib.pyRwFs

(KR2R3t__doc__t	ExceptionR1R4R5RHRIRt
IMAP4_PORTRZR`RDRgRiRoRqRbRzR|RRRMRRpRRRRRRRRRRRRRRRRRRRxRRRRRARRRRRRRRRRRRRRRRRKRRRRRRRRw(((s#/usr/local/lib/python2.7/imaplib.pyRns,;																																
			
		 									
						J		L								
t	IMAP4_SSLcBsVeZdZdedddZdedZdZdZdZ	dZ
RS(	sIMAP4 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.
        R6cCs)||_||_tj|||dS(N(tkeyfiletcertfileRRZ(RTRURVRR
((s#/usr/local/lib/python2.7/imaplib.pyRZs		cCsd||_||_tj||f|_tj|j|j|j|_	|j	j
d|_dS(sSetup 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.
            RaN(RURVRbRcRdtssltwrap_socketRR
tsslobjReRf(RTRURV((s#/usr/local/lib/python2.7/imaplib.pyRDs
		!cCsYt|}xF|dkrT|jj|}||kr=Pn||}||}qWdS(sSend data to remote.iN(RkRtwrite(RTRntbytestsent((s#/usr/local/lib/python2.7/imaplib.pyRos
cCs|jj|jjdS(s Close I/O established in "open".N(RfRpRd(RT((s#/usr/local/lib/python2.7/imaplib.pyRqs
cCs|jS(snReturn socket instance used to connect to IMAP4 server.

            socket = <instance>.socket()
            (Rd(RT((s#/usr/local/lib/python2.7/imaplib.pyRbscCs|jS(sReturn SSLObject instance used to communicate with the IMAP4 server.

            ssl = ssl.wrap_socket(<instance>.socket)
            (R(RT((s#/usr/local/lib/python2.7/imaplib.pyRsN(R2R3RtIMAP4_SSL_PORTR<RZRDRoRqRbR(((s#/usr/local/lib/python2.7/imaplib.pyRs
			cBsJeZdZdZdddZdZdZdZdZ	RS(sIMAP4 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(RRRZ(RTR((s#/usr/local/lib/python2.7/imaplib.pyRZs	c
Csyd|_d|_d|_d|_tj|jdtjdtjdt	dt	|_
|j
j|_|j
j
|_dS(sSetup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        tstdintstdouttshellt	close_fdsN(R<RURVRdRft
subprocesstPopenRtPIPEtTrueRRt	writefileRtreadfile(RTRURV((s#/usr/local/lib/python2.7/imaplib.pyRDs				cCs|jj|S(sRead 'size' bytes from remote.(RRg(RTRh((s#/usr/local/lib/python2.7/imaplib.pyRgscCs
|jjS(sRead line from remote.(RRi(RT((s#/usr/local/lib/python2.7/imaplib.pyRiscCs!|jj||jjdS(sSend data to remote.N(RRtflush(RTRn((s#/usr/local/lib/python2.7/imaplib.pyRoscCs+|jj|jj|jjdS(s Close I/O established in "open".N(RRpRRtwait(RT((s#/usr/local/lib/python2.7/imaplib.pyRqs

N(
R2R3RRZR<RDRgRiRoRq(((s#/usr/local/lib/python2.7/imaplib.pyRs					RcBs2eZdZdZdZdZdZRS(scPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dS(N(R(RTtmechinst((s#/usr/local/lib/python2.7/imaplib.pyRZscCs5|j|j|}|dkr(dS|j|S(NR(RtdecodeR<tencode(RTRntret((s#/usr/local/lib/python2.7/imaplib.pyRscCsrd}xe|rmt|dkr8|d }|d}n|}d}tj|}|r	||d }q	q	W|S(NR6i0i(Rktbinasciit
b2a_base64(RTtinptoupttRu((s#/usr/local/lib/python2.7/imaplib.pyR#s		

cCs|s
dStj|S(NR6(R%t
a2b_base64(RTR'((s#/usr/local/lib/python2.7/imaplib.pyR""s(R2R3RRZRR#R"(((s#/usr/local/lib/python2.7/imaplib.pyRs
			itJanitFebitMaritApritMayitJunitJulitAugi	tSepi
tOctitNovitDecc	Csvtj|}|sd
St|jd}|jd}t|jd}t|jd}t|jd}t|jd}t|jd}t|jd}	t|jd	}
|	d
|
d
}|dkr|}n||||||dddf	}tj|}
tj|
}tj	rX|drX|tj
}n
|tj}tj|
|S(sParse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time instance or None if the string has wrong format.
    tmontzonentdaytyearthourtmintsectzonehtzonemi<t-iN(tInternalDateRR<tMon2numRRttimetmktimet	localtimetdaylighttaltzonettimezone(RRR7R8R9R:R;R<R=R>R?tzonettttutctlt((s#/usr/local/lib/python2.7/imaplib.pyR,s,
!
cCsRd}d}tt|}x-|rMt|d\}}|||}q!W|S(s-Convert integer to A-P string representation.R6tABCDEFGHIJKLMNOPi(Rtabstdivmod(tnumRtAPtmod((s#/usr/local/lib/python2.7/imaplib.pyRYs	cCs2tj|}|sdSt|jdjS(s-Convert IMAP4 flags response to python tuple.R((tFlagsRRNRRP(RR((s#/usr/local/lib/python2.7/imaplib.pyRfscCst|tttfr*tj|}nZt|ttjfrK|}n9t|trx|d|dfdkrx|St	dtj
d|}|ddkrd|d}ntjr|drtj}n
tj
}d|d	t|d
d
dS(sConvert 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.
    iiRsdate_time not of a known types%d-%b-%Y %H:%M:%St0Ris
 %+03d%02di<(RR(t
isinstanceRtlongtfloatRCRERNtstruct_timetstrt
ValueErrortstrftimeRFRGRHRO(RRJtdtRI((s#/usr/local/lib/python2.7/imaplib.pyRqs	)

t__main__sd:s:s-ds-sR6sIMAP password for %s on %s: t	localhostsJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)sRs
tlfRRs
/tmp/xxx 1Rs/tmp/yyys
/tmp/yyz 2RRs/tmpsyy*RRtSUBJECTttestRt1s(FLAGS INTERNALDATE RFC822)RtFLAGSs
(\Deleted)RRRzRpR|tUIDVALIDITYRtALLRRcCsitjd||ftt||\}}tjd|||f|dkre|dn|S(Ns%s %ss%s => %s %sRi(tMt_mesgR\(tcmdRRWRX((s#/usr/local/lib/python2.7/imaplib.pytruns
sPROTOCOL_VERSION = %ssCAPABILITIES = %rs/tmp/syy%s.*"([^"]+)"$Rs%ss:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)s
All tests OK.s
Tests failed.s8
If you would like to see debugging output,
try: %s -d5
(IRt__version__R%RsRERHRbRRRCt__all__RR9R
RRRRjR[RIRRSRARRRRRRRtImportErrorRRRRRBRRRRR2tgetopttgetpasstargvtoptlistRR1RR<tstream_commandtoptRRUtgetusertUSERtPASSWDt	test_mesgt	test_seq1t	test_seq2RiRfR;RgRSRQRhtmlRRRtpathRPRXR(((s#/usr/local/lib/python2.7/imaplib.pyt<module>s,`		



































B
9,--	-	
		 #
						
	

Zerion Mini Shell 1.0