Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/offlineimap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/imaplib2.pyo
�
��Vc@sddZddddddfZdZdZd	Zd
ZdZdZd
Zddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZeekr�ddlZeZnddlZeZde_eZdZeZdZdZ dZ!ddZ"dZ#dZ$dZ%dZ&dZ'dZ(ddfZ)dZ*dZ+d d!d"d#f\Z,Z-Z.Z/i*e-e.fe0fd$6e,fe0fd%6e,e-e.fe1fd&6e.fe1fd'6e.fe0fd(6e-fe0fd)6e.fe1fd*6e-e.fe1fd+6e-e.fe1fd,6e-e.fe1fd-6e-e.fe0fd.6e.fe1fd/6e.fe1fd06e-e.fe1fd16e-e.fe1fd26e-e.fe1fd36e-e.fe1fd46e,e-e/e.fe1fd56e.fe0fd66e-e.fe1fd76e,fe0fd86e,e-e/e.fe0fd#6e-e.fe1fd96e-e.fe1fd:6e-e.fe1fd;6e,e-e.fe1fd<6e.fe1fd=6e-fe0fd>6e-e.fe1fd?6e.fe1fd@6e-e.fe0fdA6e-e.fe0fdB6e-e.fe1fdC6e-e.fe0fdD6e.fe1fdE6e,fe0fdF6e-e.fe1fdG6e.fe1fdH6e-e.fe0fdI6e.fe1fdJ6e.fe1fdK6e-e.fe0fdL6Z2d@dEdJfZ3dM�Z4dNe5fdO��YZ6de5fdP��YZ7de7fdQ��YZ8de7fdR��YZ9dSe5fdT��YZ:dUe5fdV��YZ;edWdXdYdZd[d\d]d^d_d`dadbg
Z<e=e>e?dc�e<dD�e>e@ddd�����ZAe
jBde�ZCdf�ZDeDZEdg�ZFe
jBdh�ZGdi�ZHeIdjkr`eJr�eKdk��nddlLZLddlMZMy#eLjLejNddl�\ZOZPWn(eLjQk
rZZRfff\ZOZPnXefdm\ZSZTZUZVZWZXZYx�eOD]�\ZZZReZdnkr�e[eR�ZSeSdZTn�eZdokr�dZYn�eZdpkryeRj\dq�\ZWZXWn#eKk
reReRf\ZWZXnXnCeZdrkr3e[eR�ZUn(eZdskr[eRZVePrXeVfZPnnq�WePrrdtfZPneUr�eWek	o�e p�eZUnePdZ]eMj^�Z_e`ejajbdu�o�dup�ec�jddv�Zedwie_dx6dydz6eed{6Zfd|d}d}ffd|d}d~ffdd�ffd�d�d�ffd+d�ffd�d�eeefffd|dtd�ffd�d�ffd�ed�d�ffd�d�d�ffd�d�d�d�ffd�ffd�ffd�ffd�ffgZgd�ffd�d�ffd�d�ffd�eeeefffd�ffd�ffd�d�d�ffd�ffd�ffd�d@d�d�ffd�d@d�ffd�dJd�d�d�ffd�fff
Zheef\aiZjd��Zke1d��Zlynejm�jnd��eWek	r'
eWr�	eZWneXr�	eZXne8d�e]d�eUd�eWd�eXd�d�d�eSd�dtd�d�d�eTd�d�
ZjnZeVrT
e9eVd�eSd�dtd�d�d�eT�Zjn-e7d�e]d�eUd�eSd�dtd�d�d�eT�Zjejjod!kr�
eMjMd�e_e]p�
d�f�Zpegjqdd�e_epff�nejjrdd�ejjs�d�ejjtkrejju�nx!egD]\ZvZPeleveP�qWxmeld|dtd�fd�e0�D]PZwe
jxd�ew�Zyeyrqeyjzd�Zanewj\�dZaeld�eaf�qAWd5ejjtkr�eld�f�eld�d�f�eld�d�ed�ej{�df�nx�ehD]�\ZvZPevePfd�d@d�d�ffkr.eleveP�q�nelevePd�e0�Z|e|dj\�Z}e}r`q�neld�d0e}dd�f�eld�dHe}dd�d�f�eld�f�q�Wd6ejjtkrneld�d�fd�e0�eld�d�f�ej~d�eld�fd�e0�eld�eeeeffd�e0�eld�ed�fd�e0�dj\�dZeld�ed�fd�e0�Z|ejj�d�ee�e|�f�eld�d�f�eld�ed�d�fd�e0�feld�ed�fd�e0�Z|ejj�d�ee�e|�f�eld�dHed�d�f�eld�f�eYrkejj�d��yeld�d�fd�e0�Wn.e�k
rgejj�d��ejj�dt��nXnneYr�ejj�d��neld�fd�e0�eSrejj�dt�ejj��ejj�dt�ejj�d��x1ejj��D]#\Z�Z|ejj�d�e�e|f�q�Wnd�GHWnOeYp1ejekp1d6ejjtkrYd�GHeSrSd�ejNdGHn�nnXndS(�sThreaded IMAP4 client.

Based on RFC 3501 and original imaplib module.

Public classes:   IMAP4
                  IMAP4_SSL
                  IMAP4_stream

Public functions: Internaldate2Time
                  ParseFlags
                  Time2Internaldate
tIMAP4t	IMAP4_SSLtIMAP4_streamtInternaldate2Timet
ParseFlagstTime2Internaldates2.52t2t52s�

Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
String method conversion by ESR, February 2001.
GET/SETACL contributed by Anthony Baxter <anthony@interlink.com.au> April 2001.
IMAP4_SSL contributed by Tino Lange <Tino.Lange@isg.de> March 2002.
GET/SETQUOTA contributed by Andreas Zeidler <az@kreativkombinat.de> June 2002.
PROXYAUTH contributed by Rick Holbert <holbert.13@osu.edu> November 2002.
IDLE via threads suggested by Philippe Normand <phil@respyre.org> January 2005.
GET/SETANNOTATION contributed by Tomas Lindroos <skitta@abo.fi> June 2005.
COMPRESS/DEFLATE contributed by Bron Gondwana <brong@brong.net> May 2009.
STARTTLS from Jython's imaplib by Alan Kennedy.
ID contributed by Dave Baggett <dave@baggett.org> November 2009.
Improved untagged responses handling suggested by Dave Baggett <dave@baggett.org> November 2009.
Improved thread naming, and 0 read detection contributed by Grant Edwards <grant.b.edwards@gmail.com> June 2010.
Improved timeout handling contributed by Ivan Vovnenko <ivovnenko@gmail.com> October 2010.
Timeout handling further improved by Ethan Glasser-Camp <glasse@cs.rpi.edu> December 2010.
Time2Internaldate() patch to match RFC2060 specification of English month names from bugs.python.org/issue11024 March 2011.
starttls() bug fixed with the help of Sebastian Spaeth <sebastian@sspaeth.de> April 2011.
Threads now set the "daemon" flag (suggested by offlineimap-project) April 2011.
Single quoting introduced with the help of Vladimir Marek <vladimir.marek@oracle.com> August 2011.
Support for specifying SSL version by Ryan Kavanagh <rak@debian.org> July 2013.
Fix for gmail "read 0" error provided by Jim Greenleaf <james.a.greenleaf@gmail.com> August 2013.
Fix for offlineimap "indexerror: string index out of range" bug provided by Eygene Ryabinkin <rea@codelabs.ru> August 2013.
Fix for missing idle_lock in _handler() provided by Franklin Brook <franklin@brook.se> August 2014.
Conversion to Python3 provided by F. Malina <fmalina@gmail.com> February 2015.
Fix for READ-ONLY error from multiple EXAMINE/SELECT calls by Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> March 2015.
Fix for null strings appended to untagged responses by Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> March 2015.
Fix for correct byte encoding for _CRAM_MD5_AUTH taken from python3.5 imaplib.py June 2015.
Fix for correct Python 3 exception handling by Tobias Brink <tobias.brink@gmail.com> August 2015.
Fix to allow interruptible IDLE command by Tim Peoples <dromedary512@users.sf.net> September 2015.
Add support for TLS levels by Ben Boeckel <mathstuf@gmail.com> September 2015.
Fix for shutown exception by Sebastien Gross <seb@chezwam.org> November 2015.s!Piers Lauder <piers@janeelix.com>shttp://imaplib2.sourceforge.netsPython Licensei����Ng쵠�ƠBs
i�i�s* IDLE TIMEOUT
i<iii�it
tls_securet
tls_no_sslt
tls_compatt	IMAP4REV1iitNONAUTHtAUTHtSELECTEDtLOGOUTtAPPENDtAUTHENTICATEt
CAPABILITYtCHECKtCLOSEtCOMPRESStCOPYtCREATEtDELETEt	DELETEACLtEXAMINEtEXPUNGEtFETCHtGETACLt
GETANNOTATIONtGETQUOTAtGETQUOTAROOTtIDtIDLEtLISTtLOGINtLSUBtMYRIGHTSt	NAMESPACEtNOOPtPARTIALt	PROXYAUTHtRENAMEtSEARCHtSELECTtSETACLt
SETANNOTATIONtSETQUOTAtSORTtSTARTTLStSTATUStSTOREt	SUBSCRIBEtTHREADtUIDtUNSUBSCRIBEcCsbgd}}tt|��}x3|rTt|d�\}}|jd||�q"Wdj|�S(sgstring = Int2AP(num)
    Return 'num' converted to a string using characters from the set 'A'..'P'
    tABCDEFGHIJKLMNOPiit(tinttabstdivmodtinserttjoin(tnumtvalta2ptmod((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytInt2AP�s
	tRequestcBsAeZdZddded�Zd�Zdd�Zd�ZRS(s7Private class to represent a request awaiting response.cCs�||_||_||_|s-||_n||f|_d|j|jf|_|jd7_tj�|_	d|_d|_d|_
dS(Ns%s%si(tparenttnametcallbacktcallback_argttagprettagnumttagt	threadingtEventtreadytNonetresponsetabortedtdata(tselfRFRGRHtcb_argtcb_self((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt__init__�s					cCs ||f|_|jd�dS(N(RRtdeliverRP(RTttypRA((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytabort�scCssd|_|jjtj�|jdk	rl|j\}}|dkrSd|}n||t|���n|jS(Ns%s - %%s(	RPRHROtwaitRMtTIMEOUT_MAXRRtstrRQ(RTtexc_fmtRYRA((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytget_response�s	
cCsI|jdk	r/|j||j|jf�dS||_|jj�dS(N(RHRPRIRRRQROtset(RTRQ((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRX�s	
N(	t__name__t
__module__t__doc__RPtFalseRWRZR_RX(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRE�s
	cBs�eZdZdefd��YZdefd��YZdefd��YZejd�Z	ejd�Z
ejd	�Zejd
�Zejd�Z
ejd�Zejd
�Zdededededededed�Zd�Zdeded�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%d&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/ded.�Z0d/d0d1�Z1d2�Z2d3�Z3d4�Z4d5�Z5d/d0d6�Z6d7�Z7d8�Z8d9�Z9d:�Z:d;�Z;d<�Z<d=�Z=d%e>d>�Z?d?�Z@d@�ZAdA�ZBdB�ZCdededededCeDdD�ZEdE�ZFdF�ZGdG�ZHdH�ZIdI�ZJdJ�ZKdK�ZLdL�ZMdM�ZNdN�ZOdO�ZPdP�ZQdQ�ZRdR�ZSdS�ZTdT�ZUdU�ZVe>dV�ZWdW�ZXdX�ZYdY�ZZdZ�Z[d[�Z\deded\�Z]d]�Z^d^�Z_d_�Z`d`�Zaebecda�r�db�Zdn	dc�Zddd�ZeRS(fs6Threaded IMAP4 client class.

    Instantiate with:
        IMAP4(host=None, port=None, debug=None, debug_file=None, identifier=None, timeout=None, debug_buf_lvl=None)

        host          - host's name (default: localhost);
        port          - port number (default: standard IMAP4 port);
        debug         - debug level (default: 0 - no debug);
        debug_file    - debug stream (default: sys.stderr);
        identifier    - thread identifier prefix (default: host);
        timeout       - timeout in seconds when expecting a command response (default: no timeout),
        debug_buf_lvl - debug level at which buffering is turned off.

    All IMAP4rev1 commands are supported by methods of the same name.

    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.

    All commands take two optional named arguments:
        'callback' and 'cb_arg'
    If 'callback' is provided then the command is asynchronous, so after
    the command is queued for transmission, the call returns immediately
    with the tuple (None, None).
    The result will be posted by invoking "callback" with one arg, a tuple:
        callback((result, cb_arg, None))
    or, if there was a problem:
        callback((None, cb_arg, (exception class, reason)))

    Otherwise the command is synchronous (waits for result). But note
    that state-changing commands will both block until previous commands
    have completed, and block subsequent commands until they have finished.

    All (non-callback) 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 or single 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)"). If you are using "sequence sets"
    containing the wildcard character '*', then enclose the argument
    in single quotes: the quotes will be removed and the resulting
    string passed unquoted. Note also that you can pass in an argument
    with a type that doesn't evaluate to 'string_types' (eg: 'bytearray')
    and it will be converted to a string without quoting.

    There is one instance variable, 'state', that is useful for tracking
    whether the client needs to login to the server. If it has the
    value "AUTH" after instantiating the class, then the connection
    is pre-authenticated (otherwise it will be "NONAUTH"). Selecting a
    mailbox changes the state to be "SELECTED", closing a mailbox changes
    back to "AUTH", and once the client has logged out, the state changes
    to "LOGOUT" and no further commands may be issued.

    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.

    Note also that you must call logout() to shut down threads before
    discarding an instance.
    terrorcBseZRS((RaRb(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRe)sRZcBseZRS((RaRb(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRZ*streadonlycBseZRS((RaRb(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRf+ss\+( (?P<data>.*))?s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%[^!#$&'+,./0-9:;<=>?@A-Z\[^_`a-z|}~-]s)\[(?P<type>[A-Z-]+)( (?P<data>[^\]]*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?cCs�t|_d|_i|_g|_d|_t|_d|_	d|_
t|_d|_g|_
d|_d|_d|_t|_d|_ttjdd��|_tjd|jd�|_||_|dk	r�|tkr�||_n	t|_t|_|j||�|dk	r/||_ n|j!|_ |j rV|j d7_ nt|_"|_#t$j%�|_&t$j'�|_(t$j'�|_)t$j'�|_*t+j,d�|_-t+j,�|_.t$j/d|j0�|_1|j1j2t3�|j1j4�t$j/d|j5�|_6|j6j2t3�|j6j4�t$j/d|j7�|_8|j8j2t3�|j8j4�y|j9d	d
dd�j:d
�d|_;|j<d�r�t=|_n.|j<d�r�n|j>dt?|j;���|j@�\}}	|	dgkr	|j>d��ntA|	djB�jC��|_Dx<tED]%}
|
|jDkrJq/n|
|_FPq/W|j>d��Wn|jG��nXdS(Niii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)t i
ttargetRGtwelcomeRLtcontinuationsIMAP4 protocol error: %sitPREAUTHtOKs'unrecognised server welcome message: %ss"no CAPABILITY response from serveri����sserver not IMAP4 compliant(HRtstateRPtliteralttagged_commandstuntagged_responsestmailboxRdtis_readonlytidle_rqbtidle_timeoutt_expecting_datat_expecting_data_lent_accumulated_datat_literal_expectedt
compressortdecompressort_tls_establishedRKRDtrandomtrandintRJtretcompilettagretresp_timeouttREAD_POLL_TIMEOUTtread_poll_timeoutt	READ_SIZEt	read_sizetopent
identifierthostt	TerminatetTerminateReaderRMRNtstate_change_freetLocktstate_change_pendingt
commands_lockt	idle_locktqueuetQueuetouqtinqtThreadt_writertwrtht	setDaemontTruetstartt_readertrdtht_handlertintht
_request_pushR_Rit_get_untagged_responseR
Retreprt
capabilityttupletuppertsplittcapabilitiestAllowedVersionstPROTOCOL_VERSIONt_close_threads(RTR�tporttdebugt
debug_fileR�ttimeoutt
debug_buf_lvlRYtdattversion((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRW;s�																				


(	
	
cCs3|tkrt||j��Std|��dS(NsUnknown IMAP4 command: '%s'(tCommandstgetattrtlowertAttributeError(RTtattr((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt__getattr__�scCsO|jd|�|_|jt|�|_|j�|_|jj�|_dS(s�open(host=None, port=None)
        Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, send, shutdown, socket.R:N(t_choose_nonull_or_dfltR�t
IMAP4_PORTR�topen_sockettsocktfilenotread_fd(RTR�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��scCsKd}x>tj|j|jtjtj�D]	}|\}}}}}ytj|||�}Wntjk
r�}	|	}q+nXy�xdD]h}
y|j|�PWq�tjk
r�}	|	}t|j	�dks�|j	dt
jkr��q�q�Xq�Wtj|��Wn)tjk
r2}	|	}|j�q+nXPq+Wtj|��|S(sJopen_socket()
        Open socket choosing first address family available.i����scould not open socketiii(i����scould not open socket(ii(
tsockettgetaddrinfoR�R�t	AF_UNSPECtSOCK_STREAMRetconnecttlentargsterrnotEINTRtclose(RTtmsgtrestaftsocktypetprotot	canonnametsatstmti((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s2+

+
c
CsSy�ddl}i}t|d�rEi|jd6|jd6|t<n
i|t<|tj�|t<|tji|jd6�|tj�|t	<|t	ji|j
d6|j
d6�t|d�r�|t	ji|jd6�n|j
dk	r�|j}n	|j}|j|kr-td	|j��n|j||jkretjd
|j|jf��n||j|j}|j|j|j|jd|j
d|d
|�|_|j}|jj�|_Wn tk
r�tjd��nX|jdk	r3|j|jj�|j�}|r3||��q3n|jj tj!tj"d�dS(Ni����tPROTOCOL_TLSv1_2ttls1_2ttls1_1ttls1tssl23tPROTOCOL_SSLv3tssl3sunknown tls_level: %ss7Invalid SSL version '%s' requested for tls_version '%s'tca_certst	cert_reqstssl_versions1imaplib SSL mode does not work without ssl modulei(#tsslthasattrR�tPROTOCOL_TLSv1_1t
TLS_SECUREtcopyt
TLS_NO_SSLtupdatetPROTOCOL_TLSv1t
TLS_COMPATtPROTOCOL_SSLv23RPR�R�t
CERT_REQUIREDt	CERT_NONEt	tls_leveltRuntimeErrorR�R�tsslerrortwrap_socketR�tkeyfiletcertfiletSSLErrorR�R�tImportErrortcert_verify_cbtgetpeercertR�t
setsockoptt
SOL_SOCKETtSO_KEEPALIVE(RTR�tTLS_MAPR�R�tssl_exctcert_err((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytssl_wrap_socket�sH





	"6	
cCs4tjd�|_tjtjtjd�|_dS(sPstart_compressing()
        Enable deflate compression on the socket (RFC 4978).i�N(tzlibt
decompressobjRztcompressobjtZ_DEFAULT_COMPRESSIONtDEFLATEDRy(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytstart_compressingscCs_|jdkr|jj|�S|jjr:|jj}n|jjt�}|jj||�S(s@data = read(size)
        Read at most 'size' bytes from remote.N(RzRPR�trecvtunconsumed_tailR�t
decompress(RTtsizeRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytread$scCso|jdk	r=|jj|�}||jjtj�7}nttkr[t|d�}n|jj	|�dS(s)send(data)
        Send 'data' to remote.tASCIIN(
RyRPtcompresstflushR�tZ_SYNC_FLUSHtbytesR]R�tsendall(RTRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytsend3scCs^zIy|jjtj�Wn+tk
rG}|jtjkrH�qHnXWd|jj�XdS(s3shutdown()
        Close I/O established in "open".N(R�tshutdownR�t	SHUT_RDWRt	ExceptionR�tENOTCONNR�(RTte((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR	AscCs|jS(sQsocket = socket()
        Return socket instance used to connect to IMAP4 server.(R�(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�OscCsGz5|jdd�\}}|dkr4|j�nWd|j�XdS(senable_compression()
        Ask the server to start compressing the connection.
        Should be called from user of this class after instantiation, as in:
            if 'COMPRESS=DEFLATE' in imapobj.capabilities:
                imapobj.enable_compression()RtDEFLATERlN(t_simple_commandR�t_release_state_change(RTRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytenable_compressionZs
ccsGx@|jrB|jj�z|jjd�VWd|jj�XqWdS(s� for typ,data in pop_untagged_responses(): pass
        Generator for any remaining untagged responses.
        Returns and removes untagged responses in order of reception.
        Use at your own risk!iN(RpR�tacquiretpoptrelease(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytpop_untagged_responsesjs

cKs]d}|jddg|�\}}|dgkrF|j|||�S||d<|j|�S(s�(typ, [data]) = recent()
        Return 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.
        'data' is None if no new messages,
        else list of RECENT responses, most recent last.tRECENTtuntagged_responseN(t_untagged_responseRPt_deliver_dattnoop(RTtkwRGRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytrecentxs
cKs7|j|dg|j��\}}|j|||�S(s�(code, [data]) = response(code)
        Return data for response 'code' if received, or None.
        Old value for response 'code' is cleared.N(RRPR�R(RTtcodeRRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRQ�s$cKs�d}|sd}n|rE|d|dfd	krKd|}qKnd}|r`t|�}nd}|jjt|�|_z|j|||||�SWd|j�XdS(
s�(typ, [data]) = append(mailbox, flags, date_time, message)
        Append message to named mailbox.
        All args except `message' can be None.RtINBOXii����t(t)s(%s)N(RR (RPRtmapCRLF_cretsubtCRLFRnRR(RTRqtflagst	date_timetmessageRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytappend�s	cKs�t|�j|_zT|jd|j��\}}|dkr\|j|j|d|�nt|_Wd|j	�X|j
|||�S(s_(typ, [data]) = authenticate(mechanism, authobject)
        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.RRli����N(t_AuthenticatortprocessRnRR�t_deliver_excReR
RmRR(RTt	mechanismt
authobjectRRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytauthenticate�s	cKs d}||d<|j||�S(sI(typ, [data]) = capability()
        Fetch capabilities list from server.RR(R(RTRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s
cKs|jd|�S(s=(typ, [data]) = check()
        Checkpoint mailbox on server.R(R(RTR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytcheck�scKsd|jdkr!|jd��nz|jd�\}}Wdt|_|j�X|j|||�S(s�(typ, [data]) = close()
        Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.RsNo mailbox selected.RN(RmReRR
RR(RTRRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s	cKs|jd|||�S(sm(typ, [data]) = copy(message_set, new_mailbox)
        Copy 'message_set' messages onto end of 'new_mailbox'.R(R(RTtmessage_settnew_mailboxR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��scKs|jd||�S(s;(typ, [data]) = create(mailbox)
        Create new mailbox.R(R(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytcreate�scKs|jd||�S(s;(typ, [data]) = delete(mailbox)
        Delete old mailbox.R(R(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytdelete�scKs|jd|||�S(sk(typ, [data]) = deleteacl(mailbox, who)
        Delete the ACLs (remove any rights) set for who on mailbox.R(R(RTRqtwhoR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt	deleteaclsRcKs|jd|dt|�S(sU(typ, [data]) = examine(mailbox='INBOX')
        Select a mailbox for READ-ONLY access. (Flushes all untagged responses.)
        'data' is count of messages in mailbox ('EXISTS' response).
        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via "response('FLAGS')" etc.RqRf(tselectR�(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytexaminescKs d}||d<|j||�S(s�(typ, [data]) = expunge()
        Permanently remove deleted items from selected mailbox.
        Generates 'EXPUNGE' response for each deleted message.
        'data' is list of 'EXPUNGE'd message numbers in order received.RR(R(RTRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytexpunges
cKs&d}||d<|j||||�S(sA(typ, [data, ...]) = fetch(message_set, message_parts)
        Fetch (parts of) messages.
        '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,
        followed by a string containing the trailer.RR(R(RTR/t
message_partsRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytfetchs
cKsd|d<|jd||�S(sC(typ, [data]) = getacl(mailbox)
        Get the ACLs for a mailbox.tACLRR(R(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytgetacl*s
cKs#d|d<|jd||||�S(sV(typ, [data]) = getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.t
ANNOTATIONRR(R(RTRqtentryt	attributeR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt
getannotation2s
cKsd|d<|jd||�S(s�(typ, [data]) = getquota(root)
        Get the quota root's resource usage and limits.
        (Part of the IMAP4 QUOTA extension defined in rfc2087.)tQUOTARR(R(RTtrootR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytgetquota:s
cKsg|jd|�\}}|j||d�\}}|j||d�\}}|j|||g|�S(s�(typ, [[QUOTAROOT responses...], [QUOTA responses...]]) = getquotaroot(mailbox)
        Get the list of quota roots for the named mailbox.R R@t	QUOTAROOT(RRR(RTRqRRYR�tquotat	quotaroot((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytgetquotarootCscOs�d}||d<|sd}nZt|�dkr>|d}n;ddjg|D]!}|ri|j|�pld^qN�}|j|||�S(s�(typ, [data]) = <instance>.id(kv_pairs)
        'kv_pairs' is a possibly empty list of keys and values.
        'data' is a list of ID key value pairs or NIL.
        NB: a single argument is assumed to be correctly formatted and is passed through unchanged
        (for backward compatibility with earlier version).
        Exchange information for problem analysis and determination.
        The ID extension is defined in RFC 2971. R!RtNILiis(%s)Rg(R�R?t_quoteR(RTtkv_pairsRRGRStarg((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytidQs	
	
;cKsAd}t||�j|_z|j||�SWd|j�XdS(s�"(typ, [data]) = idle(timeout=None)
        Put server into IDLE mode until server notifies some change,
        or 'timeout' (secs) occurs (default: 29 minutes),
        or another IMAP4 command is scheduled.R"N(t	_IdleContR)RnRR(RTR�RRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytidlegs
s""t*cKs&d}||d<|j||||�S(sN(typ, [data]) = list(directory='""', pattern='*')
        List mailbox names in directory matching pattern.
        'data' is list of LIST responses.

        NB: for 'pattern':
        % matches all except separator ( so LIST "" "%" returns names at root)
        * matches all (so LIST "" "*" returns whole directory tree from root)R#R(R(RTt	directorytpatternRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytlistus	
cKs{zZ|jd||j|��\}}|dkrP|j|j|d|�nt|_Wd|j�X|j|||�S(s~(typ, [data]) = login(user, password)
        Identify client using plaintext password.
        NB: 'password' will be quoted.R$Rli����N(RRHR*ReR
RmRR(RTtusertpasswordRRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytlogin�s$	cKs)|||_|_|jd|j|�S(s\(typ, [data]) = login_cram_md5(user, password)
        Force use of CRAM-MD5 authentication.sCRAM-MD5(RRRSR-t_CRAM_MD5_AUTH(RTRRRSR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytlogin_cram_md5�scCs]ddl}t|jt�r0|jjd�n|j}|jd|j||d�j�S(s/Authobject to use with CRAM-MD5 authentication.i����NRRgtmd5(thmact
isinstanceRSR]tencodeRRtHMACt	hexdigest(RTt	challengeRXtpwd((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRU�s$	cKs�t|_zOy|jd�\}}Wn%ddtj�d g}}nX|j�Wd|j�X|jddt�}|r�d|}}n|j	|||�S(s�(typ, [data]) = logout()
        Shutdown connection to server.
        Returns server 'BYE' response.
        NB: You must call this to shut down threads before discarding an instance.RtNOs%s: %siNtBYEtleave(
RRmRtsystexc_infoR�RR�R�R(RTRRYR�tbye((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytlogout�s	cKs&d}||d<|j||||�S(s�(typ, [data, ...]) = lsub(directory='""', pattern='*')
        List 'subscribed' mailbox names in directory matching pattern.
        'data' are tuples of message part envelope and data.R%R(R(RTRORPRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytlsub�s
cKs#d}||d<|j|||�S(sn(typ, [data]) = myrights(mailbox)
        Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).R&R(R(RTRqRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytmyrights�s
cKs d}||d<|j||�S(sM(typ, [data, ...]) = namespace()
        Returns IMAP namespaces ala rfc2342.R'R(R(RTRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt	namespace�s
cKs|jd|�S(s1(typ, [data]) = noop()
        Send NOOP command.R((R(RTR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�scKs,d}d|d<|j||||||�S(s�(typ, [data, ...]) = partial(message_num, message_part, start, length)
        Fetch truncated part of a message.
        'data' is tuple of message part envelope and data.
        NB: obsolete.R)RR(R(RTtmessage_numtmessage_partR�tlengthRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytpartial�s
cKs)z|jd||�SWd|j�XdS(s�(typ, [data]) = proxyauth(user)
        Assume authentication as 'user'.
        (Allows an authorised administrator to proxy into any user's mailbox.)R*N(RR(RTRRR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt	proxyauth�scKs|jd|||�S(sV(typ, [data]) = rename(oldmailbox, newmailbox)
        Rename old mailbox name to new.R+(R(RTt
oldmailboxt
newmailboxR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytrename�scOsBd}||d<|r/|j|d|||�S|j|||�S(s�(typ, [data]) = search(charset, criterion, ...)
        Search mailbox for matching messages.
        'data' is space separated list of matching message numbers.R,RtCHARSET(R(RTtcharsettcriteriaRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytsearchs

cKsO||_t|�|_|r'd}nd}z�|j||�}|jd|j�\}}|dkr�|jtkr�t|_n|dkr�|j	|j
d||||f|�n|j|||�St|_Wd|j�X|j
dd	t�r|r|j	|jd
||�n|j|dgd�\}}|j|||�S(sO(typ, [data]) = select(mailbox='INBOX', readonly=False)
        Select a mailbox. (Flushes all untagged responses.)
        'data' is count of messages in mailbox ('EXISTS' response).
        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via "response('FLAGS')" etc.RR-scommand: %s => %%sRltBADs%%s command error: %s %s. Data: %.100sNs	READ-ONLYRas%s is not writabletEXISTS(RqtboolRrt_commandR_RGRmRR
R*ReRRR�R�RfRRP(RTRqRfRRGtrqbRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR5s*		)	cKs/z|jd||||�SWd|j�XdS(sE(typ, [data]) = setacl(mailbox, who, what)
        Set a mailbox acl.R.N(RR(RTRqR3twhatR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytsetacl0scOsd|d<|jd||�S(sT(typ, [data]) = setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.R<RR/(R(RTR�R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt
setannotation:s
cKs6d|d<z|jd|||�SWd|j�XdS(sT(typ, [data]) = setquota(root, limits)
        Set the quota root's resource limits.R@RR0N(RR(RTRAtlimitsR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytsetquotaBs
cOsPd}|d|dfdkr-d|}n||d<|j|||||�S(	sl(typ, [data]) = sort(sort_criteria, charset, search_criteria, ...)
        IMAP4rev1 extension SORT command.R1ii����RR s(%s)R(RR (R(RTt
sort_criteriaRrtsearch_criteriaRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytsortMs


R�cKs�d}||jkr'|jd��n|jrB|jd��nd|_t|_z|j|�\}	}
Wd|j�|jj	�t
|_t|_X|	dkr�tj
d|j�|_|jjt�|jj�|jd|
��n||_||_||_||_||_||_z|j�Wdtj
d|j�|_|jjt�|jj�X|j�\}	}
|
dgkr�|jd	��nt|
d
j�j��|_t|_|j|	|
|�\}	}
|j|	|
|�S(s�(typ, [data]) = starttls(keyfile=None, certfile=None, ca_certs=None, cert_verify_cb=None, ssl_version="ssl23", tls_level="tls_compat")
        Start TLS negotiation as per RFC 2595.R2sTLS not supported by serversTLS session already establishediNRlRhs"Couldn't establish TLS session: %ss"no CAPABILITY response from serveri����( R�RZR{R�R�R�RRR�R?RdR�RMR�R�R�R�ReR�R�R�R�R�R�R�R�RPR�R�R�RR(RTR�R�R�R�R�R�RRGRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytstarttlsXsH			

	

							cKs&d}||d<|j||||�S(s[(typ, [data]) = status(mailbox, names)
        Request named status conditions for mailbox.R3R(R(RTRqtnamesRRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytstatus�s
cKsJ|d|dfd	kr'd|}nd|d<|jd||||�S(
sl(typ, [data]) = store(message_set, command, flags)
        Alters flag dispositions for messages in mailbox.ii����RR s(%s)RRR4(RR (R(RTR/tcommandR$R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytstore�s

cKs)z|jd||�SWd|j�XdS(sD(typ, [data]) = subscribe(mailbox)
        Subscribe to new mailbox.R5N(RR(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt	subscribe�scOs)d}||d<|j|||||�S(sv(type, [data]) = thread(threading_alogrithm, charset, search_criteria, ...)
        IMAPrev1 extension THREAD command.R6R(R(RTtthreading_algorithmRrR�RRG((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytthread�s
cOsG|j�}|tkr!|}nd}||d<|jd|||�S(s�(typ, [data]) = uid(command, arg, ...)
        Execute "command arg ..." with messages identified by UID,
            rather than message number.
        Assumes 'command' is legal in current state.
        Returns response appropriate to 'command'.RRR7(R�t
UID_directR(RTR�R�Rtresp((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytuid�s	
cKs)z|jd||�SWd|j�XdS(sJ(typ, [data]) = unsubscribe(mailbox)
        Unsubscribe from old mailbox.R8N(RR(RTRqR((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytunsubscribe�scOsZ|j�}|tkr1|jftft|<nz|j|||�SWd|j�XdS(s�(typ, [data]) = xatom(name, arg, ...)
        Allow simple extension commands notified by server in CAPABILITY response.
        Assumes extension command 'name' is legal in current state.
        Returns response appropriate to extension command 'name'.N(R�R�RmRdRR(RTRGR�R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytxatom�scCs�|dkrd}n|jj�|jrV|jd\}}||kr\d}q\nd}|dkr�g}|jj||g�n|j|�|jj�dS(NR:i����(RPR�RRpR'R(RTRYR�turnturd((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt_append_untagged�s	
	

cCsc|jddt�}|r_ttkrI|j|djdd���q_|j|d��ndS(NR`Rai����Rtreplace(R�R�R]RRZtdecode(RTRd((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt
_check_byes
"cCs�t|t�s|St|�dkrI|d|dfd	d
fkrI|St|�dkr�|d|dfdkr�|dd!S|r�|jj|�dkr�|S|j|�S(
Niii����RR t"t'i(RR (R�R�(R�R�((R�R�(RYtstring_typesR�t
mustquote_creRtRPRH(RTRJ((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt_checkquote
s2,cGs[t|t�rt}nt|�}x0|D](}|dk	r+t||�rS|Sq+q+W|S(N(RYR�ttypeRP(RTtdfltR�tdflttypRJ((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s	
cOs�t|trd}nd}|jj�|j�|dkrP|jj�ne|j�|jj�|jr�|j	j
�t}nt}|jj�|r�|j	j
tj�n|jt|tkrd|_|jd||jdjt|t�f��n|j�|dkrD|jj�g|_|jj�ndx'dD]}x|j|�riqTqTWqKW|jr�|jd
dt�r�d|_|jd��n|jr�|jd
��n|jd||�}d|j|f}x9|D]1}	|	dkr
q�nd||j|	�f}q�W|j}
|
dk	r|d|_t|
t �rsd}d|t!|
�f}q||
}nd|t"f|_#|
dkr�|j$j%|�|S|jd|dd�}|j$j%|�x�tr�|j&d|�\}
}|
sPn|dk	r!|||�}
n|
dkr1Pn|dk	rX|jd|dd�}nd|
t"f|_#|j$j%|�|dkr�Pq�q�W|S(Ntasynctsyncs9command %s illegal in state %s, only allowed in states %ss, RR-RlR_Rus	READ-ONLYRas#mailbox status changed to READ-ONLYsconnection closedRGs%s %ss%s {%s}s%s%sRLRjscommand: %s => %%s(sEXAMINEsSELECT(sOKsNOsBAD('R�t
CMD_VAL_ASYNCR�Rt	_end_idleRR�R�RoR�tclearR�RdR[RMR\RmtCMD_VAL_STATESRPRnReR?RpR�RrRfR�RZR�RLR�RYR�R�R#RSR�tputR_(RTRGR�Rtcmdtypt
need_eventRYRyRSRJRnt	literatortcrqbtok((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRx's�	




	
	
		*

	
		
				cCs�|j�|jd|j�\}}|dkrZ|jd|j|||jf��nd|kr}|j|||d�S||fS(Nscommand: %s => %%sRus%%s command error: %s %s. Data: %.100sR(R�R_RGReRSR(RTRyRRYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt_command_complete�s
(cCsL|\}}}|\}}|d|_|jd�|_|dk	rf|\}}|j||�dS|jddt�}	|	r�ttkr�|j|j|	dj	dd��n|j|j|	d�dS|\}}
|dkr|j|j
d	|j||
|jf�dSd
|kr;|j
||
|d
�}n|j|�dS(NRHRUR`Rai����RR�Rus%%s command error: %s %s. Data: %.100sR(RHtgetRIRPRZR�R�R]RR�ReRGRSRRX(RTtcb_arg_listRQRUReRyRRYRARdR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt_command_completer�s*
&)cCs?d|kr5|d||f|jd�df�n||fS(NRHRU(R�RP(RTRYR�R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s)cCsEd|kr5|dd|jd�||ff�n||��dS(NRHRU(RPR�(RTtexcR�R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR*�s)cCss|jj�|j}|dkr3|jj�dSd|_d|_|jj�dt|_|jj	|�dS(NsDONE%s(
R�RRsRPRRtR#RSR�R�(RTtirqb((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s
	
		

cCst|jj�xSt|j�D]B\}\}}||kr|sN|j|=n|jj�|SqW|jj�dS(N(R�Rt	enumerateRpRRP(RTRGRaR�RYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s
"


cCs|j|�|_|jdk	S(N(tmatchtmoRP(RTtcreR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt_match�sc	CsH|jr�t|�}t|j|�}|j|8_|jdk|_||krh|jj|�dS|jj|| �||}n|jr�|j\}}|j||dj|j�f�g|_n|d }d|j	kr�t
}nt}|jdk	r�|}|j
|j|�rV||jd<t
|_t|jjd��|_dS|jd}d|_|r�|j||�q�nv|j
|j|�rM|jjd�}|jjd�}|jjd	�}|dkr|j
|j|�r|j|jjd�|jjd	��n||j	kr1q�|j|||gf�n�d}|j
|j|�s�|j
|j|�r�|jjd
�}q�n|jdkr�|j
|j|�r�|s�dS|jdt
|jjd	�f�dSdS|jjd�}|jjd	�}|dkr&d}n|r=|d|}n|j
|j|�r�t
|_t|jjd��|_||g|_dS|j||�|dkr�|j
|j|�r�|j|jjd�|jjd	��n|d
kr�|j�n|r|jdt|f�n|dkrD|dkrDt
|_qDndS(NiR:i����RjiRRLR�RSRlR_Rutdata2RgR`(sOKsNOsBAD(sOKsNOsBAD(sNOsBADsBYE(RuR�tminRvRwR'RxR�R?RoR�RdRPR�tliteral_creR;R�tgroupR�tresponse_code_cret_request_poptuntagged_response_cretuntagged_status_cretcontinuation_creR�R�(	RTR�trlentdlenRYR�tcontinuation_expectedRLtdat2((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt
_put_response�s�	
	"
	
	
	!+"		!+
cCs d|jdd�jdd�S(Ns"%s"s\s\\R�s\"(R�(RTRJ((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRHkscCs#|jj�r|jj�ndS(N(R�tlockedR(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRps
cCsk|jj�|jj|�}|js1t}nt}|jj�|j|�|rg|jj	�ndS(N(
R�RRoRR�RdRRXR�R`(RTRGRSRyR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�ws
		

cKsX|jj�t|d||�}|dkr:|j}n||j|<|jj�|S(NRG(R�RRERPRLRoR(RTRLRGRRy((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s


c	OsQd|kr5|j|d|jd|dt|�dS|j|j||�|�S(NRHRURV(NN(RxR�R�RPR�(RTRGR�R((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s%cCsr|dkr||fS|j|�}|s8|dgfSx-trg|j|�}|sZPn||7}q;W||fS(NR_(R�RPR�(RTRYR�RGRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s

	cCsE|jjd�|jj�|j�|jj�|jj�dS(N(R�R�RPR�R?R	R�R�(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s



c	Cs�|j}tj�j|jd�tjd�|jd}}xc|js�|j	j
�|jdk	r�|jtj�}|dkr�d}q�n|}|j	j
�y|jjt|�}Wnwtjk
r8|jdkr|dk	rC|jrC|jd|}}PqCqCn|jtj�kr/qCnt}nX|dkrIPnt|t�sh|\}}Pny|j|�WqC|jdtj�d }}PqCXqCWt|_x]|jj�sy2|jj�}|dk	r�|j||�nWq�tjk
r
Pq�Xq�W|jjd�|j j
�x?t!|jj"��D](}|jj#|�}|j||�qBW|j$j%�|j j
�dS(	Nthandlerg�������?sconnection terminatediisno response after %s secssprogram error: %s - %si(&R�RMt
currentThreadtsetNameR�ttimetsleepRZR�R�RRtRPRR�R�R�R�tEmptyRsRotIDLE_TIMEOUT_RESPONSERYR�R�ReRbRcR�temptyt
get_nowaitR�R�RQtkeysRR�R`(	RTR�RYRAR�tlinetqelRGRy((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��sd	

	

			


tpollcCs�tj�j|jd�d�}ttkr8d}nd}tj�}|j|j	tj
�d}t}|jd}x5|p�|j
s�|jtkr�d}n|}y�|j|�}|s�w|n|d\}	}
|
tj
@rQ|j|j�}d}t|�}
|
dkrL|d7}|dkr9td	��ntjd
�w|nd}x�trMttkr�|jd|�}|dkr�|||7}Pn|d7}d|||||!jdd
�}}}nY|jd|�}|dkr�|||7}Pn|d7}d|||||!}}}|jj|�|jrUt}qUqUWn|
tj
@rtt||
���nWq|dtj�d }|jj|j|f�Pq|Xq|W|j|j	�dS(NtreadercSsXidtj6dtj6dtj6}djg|j�D]}||@r7||^q7�S(NtErrorsHang ups$Invalid request: descriptor not openRg(R5tPOLLERRtPOLLHUPtPOLLNVALR?R�(Rmt
PollErrorsR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt
poll_errors



R:ii�i
iisToo many read 0g�������?s
terrorstignoressocket error: %s - %si( RMR�R�R�RR]R5R�tregisterR�tPOLLINRdR�R�RmRRR�R�tIOErrorR�R�R�tfindR�R�R�R�RbRcRZt
unregister(RTR�t	line_partR�trxzerot	terminateR�R�trtfdRmRSR�R�tstopR�treason((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�sn		
	


	
.
		cCsUtj�j|jd�ttkr/d}nd}d}t}x
|pP|jsP|jt	krkd}n	|j
}y�tj|jggg|�\}}}|s�wDn|j
|j�}d}	t|�}
|
dkr|d7}|dkr�td��ntjd�wDnd}x�trttkr�|jd|	�}|dkr]|||	7}Pn|d7}d||||	|!jd	d
�}}	}nY|jd|	�}|dkr�|||	7}Pn|d7}d||||	|!}}	}|jj|�|jrt}qqWWqDdtj�d }
|jj|j|
f�PqDXqDWdS(
NR�R:iiisToo many read 0g�������?s
R�R�ssocket error: %s - %si(RMR�R�R�RR]RdR�RmRR�R5R�RR�R�R�R�R�R�R�R�R�R�R�RbRcRZ(RTR�R�R�R�R�twR
RSR�R�R�R�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�ps\			'

	
.
		cCs�tj�j|jd�d}xr|js�|jj�}|dkrKPny|j|j	�Wq#dt
j�d }|j|j|�Pq#Xq#W|j
j|j|f�dS(Ntwritert
Terminatedssocket error: %s - %si(RMR�R�R�R�R�R�RPRRSRbRcRZR�R�(RTR�Ry((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s	N(fRaRbRcRReRZRfR~RR�R�R!R�R�R�R�RPRWR�R�R�R�R�RRR	R�RRRRQR'R-R�R.R�R�R1R2R4R6R7R9R;R?RBRFRKRMRQRTRVRUReRfRgRhRRlRmRpRtRdR5R{R|R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�RxR�R�RR*R�R�R�R�RHRR�R�RRR�R�R�t
select_moduleR�R�(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s�Ol	
	"	:																				
		
										
									$	
			:			
	
				
			
		
	u								m								N_	G	#cBsheZdZdddddddddddded�
Zddd�Zd�Zd�Zd�Z	RS(sJIMAP4 client class over SSL connection

    Instantiate with:
        IMAP4_SSL(host=None, port=None, keyfile=None, certfile=None, ca_certs=None, cert_verify_cb=None, ssl_version="ssl23", debug=None, debug_file=None, identifier=None, timeout=None, debug_buf_lvl=None, tls_level="tls_compat")

        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);
        ca_certs       - PEM formatted certificate chain file used to validate server certificates (default: None);
        cert_verify_cb - function to verify authenticity of server certificates (default: None);
        ssl_version    - SSL version to use (default: "ssl23", choose from: "tls1","ssl3","ssl23");
        debug          - debug level (default: 0 - no debug);
        debug_file     - debug stream (default: sys.stderr);
        identifier     - thread identifier prefix (default: host);
        timeout        - timeout in seconds when expecting a command response.
        debug_buf_lvl  - debug level at which buffering is turned off.
        tls_level      - TLS security level (default: "tls_compat").

    The recognized values for tls_level are:
        tls_secure: accept only TLS protocols recognized as "secure"
        tls_no_ssl: disable SSLv2 and SSLv3 support
        tls_compat: accept all SSL/TLS versions

    For more documentation see the docstring of the parent class IMAP4.
    R�c	Cs\||_||_||_||_||_|
|_tj|||||	|
||�dS(N(R�R�R�R�R�R�RRW(RTR�R�R�R�R�R�R�R�R�R�R�R�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRWOs						cCsG|jd|�|_|jt|�|_|j�|_|j�dS(s�open(host=None, port=None)
        Setup secure connection to remote server on "host:port"
            (default: localhost:standard IMAP4 SSL port).
        This connection will be used by the routines:
            read, send, shutdown, socket, ssl.R:N(R�R�tIMAP4_SSL_PORTR�R�R�R�(RTR�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�YscCs_|jdkr|jj|�S|jjr:|jj}n|jjt�}|jj||�S(s@data = read(size)
        Read at most 'size' bytes from remote.N(RzRPR�RR�R�R�(RTRRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRfscCs�|jdk	r=|jj|�}||jjtj�7}nttkr[t|d�}nt|j	d�r�|j	j
|�nUt|�}xF|dkr�|j	j|�}||kr�Pn||}||}q�WdS(s)send(data)
        Send 'data' to remote.tutf8RiN(
RyRPRRR�RRR]R�R�RR�twrite(RTRSR�tsent((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRus
cCs|jS(sRssl = ssl()
        Return ssl instance used to communicate with the IMAP4 server.(R�(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��sN(
RaRbRcRPR�RWR�RRR�(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR1s0

		cBsPeZdZdddddd�Zddd�Zd�Zd�Zd�ZRS(s�IMAP4 client class over a stream

    Instantiate with:
        IMAP4_stream(command, debug=None, debug_file=None, identifier=None, timeout=None, debug_buf_lvl=None)

        command        - string that can be passed to subprocess.Popen();
        debug          - debug level (default: 0 - no debug);
        debug_file     - debug stream (default: sys.stderr);
        identifier     - thread identifier prefix (default: host);
        timeout        - timeout in seconds when expecting a command response.
        debug_buf_lvl  - debug level at which buffering is turned off.

    For more documentation see the docstring of the parent class IMAP4.
    c	Cse||_||_d|_d|_d\|_|_d|_tj	|dd|||||�dS(N(NN(
R�R�RPR�R�t	writefiletreadfileR�RRW(RTR�R�R�R�R�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRW�s					c
Csuddlm}m}||jdtd|d|dt�|_|jj|jj|_|_	|j	j
�|_dS(s�open(host=None, port=None)
        Setup a stream connection via 'self.command'.
        This connection will be used by the routines:
            read, send, shutdown, socket.i����(tPopentPIPEtshelltstdintstdoutt	close_fdsN(t
subprocessR�R�R�R�t_PR�R�R�R�R�R�(RTR�R�R�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR��s*cCse|jdkr"tj|j|�S|jjr=|jj}ntj|jt�}|jj||�S(sRead 'size' bytes from remote.N(RzRPtosRR�R�R�R�(RTRRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�scCs||jdk	r=|jj|�}||jjtj�7}nttkr[t|d�}n|jj	|�|jj�dS(sSend data to remote.R�N(
RyRPRRR�RRR]R�R�(RTRS((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�scCs|jj�|jj�dS(s Close I/O established in "open".N(R�R�R�(RT((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR	�s
N(	RaRbRcRPRWR�RRR	(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�s
		R(cBs2eZdZd�Zd�Zd�Zd�ZRS(sQPrivate class to provide en/de-coding
    for base64 authentication conversation.cCs
||_dS(N(tmech(RTtmechinst((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRW�scCs5|j|j|��}|dkr(dS|j|�S(NRN(R�R�RPRZ(RTRSRytret((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR)�scCsrd}xe|rmt|�dkr8|d }|d}n|}d}tj|�}|r	||d }q	q	W|S(NR:i0i����(R�tbinasciit
b2a_base64(RTtinptoupttR
((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRZ�s		

cCs|s
dStj|�S(NR:(R�t
a2b_base64(RTR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR�	s(RaRbRcRWR)RZR�(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR(�s
			RLcBs eZdZd�Zd�ZRS(sWWhen process is called, server is in IDLE state
    and will send asynchronous changes.cCs;||_|jt|�|_|jtj�|j_dS(N(RFR�tIDLE_TIMEOUTR�R�Rt(RTRFR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRW	s	cCsI|jjj�||j_|jtj�|j_|jjj�dS(N(	RFR�RRsR�R�RtRRP(RTRSRy((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR)	s
(RaRbRcRWR)(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRL
	s	tJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDecccs|]}|j�VqdS(N(RZ(t.0tx((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pys	<genexpr>$	si
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])"c	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(sJtime_tuple = Internaldate2Time(resp)
    Convert IMAP4 INTERNALDATE to UT.tmontzonentdaytyearthourR�tsectzonehtzonemi<t-i����N(tInternalDateR�RPtMon2numR�R;R�tmktimet	localtimetdaylighttaltzonettimezone(R�R�RRRRRR�RRRtzonettttutctlt((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyR-	s,
!
cCs�t|ttf�r'tj|�}nZt|ttjf�rH|}n9t|t�ru|d|dfdkru|Std��tj	r�|dr�tj
}n
tj}d|dt|d|df|dd	!t
|d
d
�S(s{'"DD-Mmm-YYYY HH:MM:SS +HHMM"' = Time2Internaldate(date_time)
    Convert 'date_time' to IMAP4 INTERNALDATE representation.ii����R�sdate_time not of a known types&"%2d-%s-%04d %02d:%02d:%02d %+03d%02d"iiiii<(R�R�(RYR;tfloatR�RR�tstruct_timeR]t
ValueErrorRRRt
MonthNamesR=(R%R!R ((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRZ	s	)

's.*FLAGS \((?P<flags>[^\)]*)\)cCs2tj|�}|sdSt|jd�j��S(sR('flag', ...) = ParseFlags(line)
    Convert IMAP4 flags response to python tuple.R$((t	FLAGS_creR�R�R�R�(R�R�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyRt	st__main__sPlease run without -Os	d:il:s:p:is-ds-is-lt:s-ps-sR:s	test.datai�sEFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)s%(data)sRRs
tlfRSRQs""t%R1timaplib2_test0Rptimaplib2_test1timaplib2_test2R'simaplib2_test%R5RttSUBJECTs
IMAP4 testR9s'1:*'s(FLAGS INTERNALDATE RFC822)R�t1tFLAGSs
(\Deleted)RhR7RR�RQtUIDVALIDITYRvR6s(FLAGS UID)R�tALLt
referencessUTF-8s(SEEN)cCs�|\}}}|\}}|dk	rN|atjdd|||f�dS|\}}tjdd||||f�|dkr�t|dfandS(Nis[cb] ERROR %s %.100s => %ssb] %s %.100s => %s %.100sR_(RPt
AsyncErrortMt_logR(R�RQRURetcmdR�RYR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt	responder�	s cCsrtrEtjddtt��tj�t\}}||��ntjsktjdd||f�ny�|r�tt|�dtd||f|�\}}tjdd||||f�n;tt|�|�\}}tjdd||||f�Wn2tjddtj	�d	 �tj��nX|d
krntjdd
�tj�t
|d��n|S(Nis
AsyncError %sis	%s %.100sRHRUs%s %.100s => %s %.100ss%s - %siR_(R6R7R8R�ReR�R�R:RbRcR(R9R�tcbRYRAR�((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pytrun�	s,
	-#$

tmainR�R�R�R�R�R�R�R�R�i
R�R�sIMAP password for %s on %s: t	localhostRTsPROTOCOL_VERSION = %ssCOMPRESS=DEFLATER;s.*"([^"]+)"$R2RKs(name imaplib2)R�R�s:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)RMiicRsfetch %s => %ss-FLAGSs(\Seen)sHIT CTRL-C to interrupt IDLEsThanks!s-chosen server does not report IDLE capabilityRes5unused untagged responses in order, most recent last:s	%s %ss
All tests OK.s
Tests failed.s8
If you would like to see debugging output,
try: %s -d5
(�Rct__all__t__version__t__release__t__revision__t__credits__t
__author__t__URL__t__license__R�R�R�R|R~R5R�RbR�RMR�RR]R�R�R�t
basestringR\R�R#RPtDebugR�R�R�RR�R�tDFLT_DEBUG_BUF_LVLR�R�R�R�R�R�RR
RRRdR�R�R�RDtobjectRERRRR(RLR'tdictRQtziptrangeRRRRtInternaldate2tupleRR(RRat	__debug__R&tgetopttgetpasstargvtoptlistR�ReRAR�R�R�tstream_commandR�R�t	idle_intrtoptR;R�R�tgetusertUSERR�tpathtexistst__file__RRSt	test_mesgt	test_seq1t	test_seq2R6R7R:R<R�R�RmtPASSWDR>R8R�R�RR9tmlR�R�R�tunameR�R�R�R@t_mesgR�tKeyboardInterruptt
_print_logRRY(((s8/usr/lib/python2.7/site-packages/offlineimap/imaplib2.pyt<module>s�	 �		
	5�������`cM,8	)		

#"
	

-									
		H'-
"
&!


)









	#

Spamworldpro Mini