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/folder/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/folder/Base.pyc
�
��Vc@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
Zdefd��YZdS(	i����N(texc_info(t
threadutil(tglobals(tgetglobalui(tOfflineImapErrort
BaseFoldercBs�eZd�Zd�Zd�Zed��Zed��Zed��Zd�Z	d�Z
d�Zd	�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 �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%�Z(d&�Z)d'�Z*d(�Z+d)�Z,d*�Z-d+�Z.d,�Z/d-�Z0d.�Z1d/�Z2e3�d0d1�Z4d2�Z5d3�Z6d4�Z7d5�Z8d6�Z9d7�Z:d8�Z;d9�Z<d:�Z=d;�Z>d<�Z?d=�Z@d>d?�ZAd@�ZBdA�ZCdB�ZDdC�ZEdD�ZFdE�ZGdF�ZHRS(GcCs�t�|_||_d
|_||j�ks6|nd|_d
|_|jdkrf|j|_nt|_	||_
|j|�|_|j|j�kr�d|_n|j
�|_|jjddt�}d|j}|jj|d|�|_|jjddt�}d|j}|jj|d|�|_|jj|dt�|_|j|j�|_|jr�|jjdd|j|f�n,|js�|jjdd	|j|f�nd
|jfd|jfd|jfg|_d
S(s�
        :param name: Path & name of folder minus root or reference
        :param repository: Repository() in which the folder is.
        ttINBOXtgeneraltutime_from_headersRepository tfilename_use_mail_timestamptdynamic_folderfilters,Running dynamic folder filtering on '%s'[%s]s*Filtering out '%s'[%s] due to folderfilterscopying messagessdeleting messagess
syncing flagsN(Rtuitffilter_nametNonetroottgetseptnametnewmail_hooktFalsethave_newmailt
repositoryt	nametranstvisiblenamet	getconfigtconfigtgetdefaultbooleant_utime_from_headert_filename_use_mail_timestampt_dynamic_folderfiltertshould_sync_foldert
_sync_thistdebugt _BaseFolder__syncmessagesto_copyt"_BaseFolder__syncmessagesto_deletet!_BaseFolder__syncmessagesto_flagstsyncmessagesto_passes(tselfRRtutime_from_header_globaltrepot"filename_use_mail_timestamp_global((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__init__sF		!				
	
			cCs|jS(sReturns name(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetnameWscCs|jS(N(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__str__[scCs
|jjS(sAccount name as string(Rtaccountname(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyR,_scCs'|js|jS|jj|j�SdS(s8Should this folder be synced or is it e.g. filtered out?N(RRRRR
(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt	sync_thises	cCs|jS(N(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyR	nscCsdS(s~Returns true if this folder suggests using threads for actions;
        false otherwise.  Probably only IMAP will return true.i((R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytsuggeststhreadsrscCs
t�dS(szImplements method that waits for thread to be usable.
        Should be implemented only for folders that suggest threads.N(tNotImplementedError(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
waitforthreadwscCstS(s� Runs quick check for folder changes and returns changed
        status: True -- changed, False -- not changed.

        :param statusfolder: keeps track of the last known folder state.
        (tTrue(R%tstatusfolder((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytquickchanged�scCs
t�dS(sXFor threading folders, returns the instancelimitname for
        InstanceLimitedThreads.N(R/(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetcopyinstancelimit�scCsdS(s�Should be true for any backend that actually saves message bodies.
        (Almost all of them).  False for the LocalStatus backend.  Saves
        us from having to slurp up messages just for localstatus purposes.i((R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytstoresmessages�scCs|jS(s3The nametrans-transposed name of the folder's name.(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetvisiblename�scCs1|j|jkr|jSd|j|jfSdS(s7Name that shows both real and nametrans-mangled values.s%s [remote name %s]N(RR(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetexplainedname�scCs|jS(s9Returns the repository object that this folder is within.(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
getrepository�scCs|jS(s=Returns the root of the folder, in a folder-specific fashion.(R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetroot�scCs|jS(s+Returns the separator for this folder type.(tsep(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyR�scCs8|j�r*|j�|j�|j�S|j�SdS(N(R9RR*(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetfullname�scCs@|jsd}n|jjdd�}tjdd|�}|S(s:Return base file name of file to store Status/UID info in.t.t/s	(^|\/)\.$s\1dot(Rtreplacetretsub(R%tbasename((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetfolderbasename�s
		cCs:|j�dkr(|j�|j�kS|j�tSdS(sYTests if the cached UIDVALIDITY match the real current one

        If required it saves the UIDVALIDITY value. In this case the
        function is not threadsafe. So don't attempt to call it from
        concurrent threads.

        :returns: Boolean indicating the match. Returns True in case it
            implicitely saved the UIDVALIDITY.N(tget_saveduidvalidityRtget_uidvaliditytsave_uidvalidityR1(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytcheck_uidvalidity�s

cCs"tjj|jj�|j��S(s@provides UIDVALIDITY cache filename for class internal purposes.(tostpathtjoinRt	getuiddirRB(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt_getuidfilename�scCs{t|d�r|jS|j�}tjj|�s@d|_n4t|d�}t|j	�j
��|_|j�|jS(s�Return the previously cached UIDVALIDITY value

        :returns: UIDVALIDITY as (long) number or None, if None had been
            saved yet.t_base_saved_uidvaliditytrtN(thasattrRLRKRGRHtexistsRtopentlongtreadlinetstriptclose(R%tuidfilenametfile((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyRC�s
cCsf|j�}|j�}t|dd��}|jd|�WdQXtj|d|�||_dS(s�Save the UIDVALIDITY value of the folder to the cache

        This function is not threadsafe, so don't attempt to call it
        from concurrent threads.s.tmptwts%d
N(RDRKRPtwriteRGtrenameRL(R%tnewvalRURV((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyRE�scCs
t�dS(s�Retrieve the current connections UIDVALIDITY value

        This function needs to be implemented by each Backend
        :returns: UIDVALIDITY as a (long) numberN(R/(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyRD�scCs
t�dS(s�Reads the message list from disk or network and stores it in
        memory for later use.  This list will not be re-read from disk or
        memory unless this function is called again.N(R/(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytcachemessagelistscCs#t|jj��dkrtStS(s)Empty everythings we know about messages.i(tlentmessagelisttkeysR1R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytismessagelistemptyscCs
i|_dS(s)Empty everythings we know about messages.N(R](R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdropmessagelistcachescCs
t�dS(sfGets the current message list.

        You must call cachemessagelist() before calling this function!N(R/(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagelistscCs
t�dS(sReturns value for empty messagelist element with given UID.

        This function must initialize all fields of messagelist item
        and must be called every time when one creates new messagelist
        entry to ensure that all fields that must be present are present.N(R/(R%tuid((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytmsglist_item_initializerscCs||j�kS(sReturns True if uid exists(Ra(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt	uidexists$scCs|j�j�S(scGets a list of UIDs.

        You may have to call cachemessagelist() before calling this function!(RaR^(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessageuidlist)scCst|j��S(sGets the number of messages.(R\Ra(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagecount0scCs
t�dS(s-Returns the content of the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
getmessage5scCs|jjd|jdd�}|dkr/dSySt|�}|dkrftd|tjj��ntj	tj�d|�SWnt
k
r�nXyJtj|d�}|dd	kr�td
|dtjj��n|SWn*t
k
rtd|tjj��nXdS(sq maxage is allowed to be either an integer or a date of the
        form YYYY-mm-dd. This returns a time_struct. s
Account %stmaxageisinvalid maxage value %di<is%Y-%m-%diils%maxage led to year %d. Abort syncing.sinvalid maxage value %sNii�Q(Rt
getdefaultR,RtintRtERRORtMESSAGEttimetgmtimet
ValueErrortstrptime(R%t	maxagestrRhtdate((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt	getmaxage:s,



cCs|jjd|jdd�S(Ns
Account %stmaxsize(Rt
getdefaultintR,R(R%((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
getmaxsizeWscCs�|jjd|jjdd�}yT|s/dStj|d�}|ddkrqtd|dtjj	��n|SWn&t
k
r�tdtjj	��nXdS(	s: Retrieve the value of the configuration option startdate sRepository t	startdates%Y-%m-%diils(startdate led to year %d. Abort syncing.sinvalid startdate value %sN(RRiRRRRmRpRRkRlRo(R%tdatestrRr((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetstartdate[s
cCsitjj|jj�d|jjd�}tjj|�sPtj|d�ntjj||j	��S(NsRepository-tStartUIDi�(
RGRHRIRtgetmetadatadirRRROtmkdirRB(R%tstartuiddir((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytget_min_uid_filels
cCsy|j�}tjj|�s"dSy9t|d�}t|j�j��}|j	�|SWnt
d|��nXdS(NRMs
Can't read %s(R~RGRHRORRPRQRRRSRTtIOError(R%tuidfiletfdtmin_uid((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytretrieve_min_uidss
cCs
t�dS(szWrites a new message, with the specified uid.

        If the uid is < 0: The backend should assign a new uid and
           return it.  In case it cannot assign a new uid, it returns
           the negative uid passed in WITHOUT saving the message.

           If the backend CAN assign a new uid, but cannot find out what
           this UID is (as is the case with some IMAP servers), it
           returns 0 but DOES save the message.

           IMAP backend should be the only one that can assign a new
           uid.

        If the uid is > 0, the backend should set the uid to this, if it can.
           If it cannot set the uid to that, it will save it anyway.
           It will return the uid assigned in any case.

        Note that savemessage() does not check against dryrun settings,
        so you need to ensure that savemessage is never called in a
        dryrun mode.N(R/(R%Rbtcontenttflagstrtime((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytsavemessage�scCs
t�dS(s3Return the received time for the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagetime�scCs
t�dS(s?Returns the message modification time of the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagemtime�scCs
t�dS(s,Returns the flags for the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessageflags�scCs
t�dS(s/Returns the keywords for the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagekeywords�scCs
t�dS(s�Sets the specified message's flags to the given set.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R/(R%RbR�((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytsavemessageflags�scCs'|j|�|B}|j||�dS(s<Adds the specified flags to the message's flag set.  If a given
        flag is already present, it will not be duplicated.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.

        :param flags: A set() of flagsN(R�R�(R%RbR�tnewflags((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytaddmessageflags�s
cCs7x0|D](}|j|�r|j||�qqWdS(s�Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(RdR�(R%tuidlistR�Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytaddmessagesflags�s
cCs'|j|�|}|j||�dS(s!Removes each flag given from the message's flag set.  If a given
        flag is already removed, no action will be taken for that flag.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�R�(R%RbR�R�((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessageflags�scCs%x|D]}|j||�qWdS(s�
        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�(R%R�R�Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessagesflags�s
cCs
t�dS(s-Returns the labels for the specified message.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessagelabels�sicCs
t�dS(s�Sets the specified message's labels to the given set.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R/(R%Rbtlabelstignorelabelstmtime((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytsavemessagelabels�scCs'|j|�|B}|j||�dS(sBAdds the specified labels to the message's labels set.  If a given
        label is already present, it will not be duplicated.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.

        :param labels: A set() of labelsN(R�R�(R%RbR�t	newlabels((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytaddmessagelabels�s
cCs%x|D]}|j||�qWdS(s�Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�(R%R�R�Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytaddmessageslabels�s
cCs'|j|�|}|j||�dS(s%Removes each label given from the message's label set.  If a given
        label is already removed, no action will be taken for that label.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�R�(R%RbR�R�((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessagelabelsscCs%x|D]}|j||�qWdS(s�
        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�(R%R�R�Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessageslabels
s
c
	Cs�|jjdd||f�|j|d�}|dkrR|jjdd�n�|jjdd|�d}td|d	�}tt|�|d	�}|jjdd
|t|||!�|t|||!�f�|}	d}
|dkrd}	d}
nG|dkrHd}	|}
d}|dt|�!|krH|
|}
qHn|jjdd|�|d|!}|jjddt|��|	d
||f|
}|jjddt|��||||S(s|Adds new header to the provided message.

        WARNING: This function is a bit tricky, and modifying it in the wrong way,
        may easily lead to data-loss.

        Arguments:
        - content: message content, headers and body as a single string
        - linebreak: string that carries line ending
        - headername: name of the header to add
        - headervalue: value of the header to add

        .. note::

           The following documentation will not get displayed correctly after being
           processed by Sphinx. View the source of this method to read it.

        This has to deal with strange corner cases where the header is
        missing or empty.  Here are illustrations for all the cases,
        showing where the header gets inserted and what the end result
        is.  In each illustration, '+' means the added contents.  Note
        that these examples assume LF for linebreak, not CRLF, so '
'
        denotes a linebreak and '

' corresponds to the transition
        between header and body.  However if the linebreak parameter
        is set to '
' then you would have to substitute '
' for
        '
' in the below examples.

          * Case 1: No '

', leading '
'

            +X-Flying-Pig-Header: i am here

            

            This is the body

            next line


          * Case 2: '

' at position 0

            +X-Flying-Pig-Header: i am here
            

            

            This is the body

            next line


          * Case 3: No '

', no leading '
'

            +X-Flying-Pig-Header: i am here

            +

            This is the body

            next line


          * Case 4: '

' at non-zero position

            Subject: Something wrong with OI

            From: some@person.at
            +
X-Flying-Pig-Header: i am here
            

            

            This is the body

            next line

        Rs&addmessageheader: called to add %s: %sii����s&addmessageheader: headers were missings,addmessageheader: headers end at position %ds	==>EOH<==iidsCaddmessageheader: header/body transition context (marked by %s): %ss%addmessageheader: insertionpoint = %dsaddmessageheader: headers = %ss%s: %ssaddmessageheader: new_header = (RR tfindtmaxtminR\trepr(
R%R�t	linebreakt
headernametheadervaluetinsertionpointtmarktcontextstartt
contextendtprefixtsuffixtheaderst
new_header((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytaddmessageheaders:<-	
cCs.|jd�}|dkr*t|�}n|S(s� Searches for the point where mail headers end.
        Either double '
', or end of string.

        Arguments:
        - content: contents of the message to search in
        Returns: position of the first non-header byte.
        s

i����(R�R\(R%R�teoh_cr((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
__find_eoh}s	cCs�|jjdd|�|j|�}|jjdd|�|d|!}|jjddt|��tjd||dtjtjB�}|r�|jd�j	�Sd	Sd	S(
s)Searches for the first occurence of the given header and returns
        its value. Header name is case-insensitive.

        Arguments:
        - contents: message itself
        - name: name of the header to be searched

        Returns: header value or None if no such header was found
        Rs"getmessageheader: called to get %ssgetmessageheader: eoh = %disgetmessageheader: headers = %ss	^%s:(.*)$R�iN(RR t_BaseFolder__find_eohR�R?tsearcht	MULTILINEt
IGNORECASEtgroupRSR(R%R�RteohR�tm((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessageheader�s
&cCs�|jjdd|�|j|�}|jjdd|�|d|!}|jjddt|��tjd||dtjtjB�S(sSearches for the given header and returns a list of values for
        that header.

        Arguments:
        - contents: message itself
        - name: name of the header to be searched

        Returns: list of header values or emptylist if no such header was found
        Rs&getmessageheaderlist: called to get %ssgetmessageheaderlist: eoh = %dis"getmessageheaderlist: headers = %ss	^%s:(.*)$R�(RR R�R�R?tfindallR�R�(R%R�RR�R�((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytgetmessageheaderlist�s
c
CsFt|�tg�kr$|g}n|jjdd|�t|�sK|S|j|�}|jjdd|�|d|!}||}|jjddt|��g}x�|jd�D]v}t}xQ|D]I}	t|�t|	�kr�|dt|	�d!|	dkr�t}Pq�q�W|r�|j	|�q�q�Wdj
|�|S(	sDeletes headers in the given list from the message content.

        Arguments:
        - content: message itself
        - header_list: list of headers to be deleted or just the header name

        We expect our message to have '
' as line endings.
        Rs)deletemessageheaders: called to delete %ss)deletemessageheaders: end of headers = %dis"deletemessageheaders: headers = %ss
it:(ttypeRR R\R�R�tsplitR1RtappendRI(
R%R�theader_listR�R�tresttnew_headersthtkeep_itttrim_h((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessageheaders�s(



9cCs
t�dS(s Change the message from existing uid to new_uid

        If the backend supports it (IMAP does not).

        :param new_uid: (optional) If given, the old UID will be changed
            to a new UID. This allows backends efficient renaming of
            messages if the UID has changed.N(R/(R%Rbtnew_uid((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytchange_message_uid�s	cCs
t�dS(s�Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R/(R%Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
deletemessage�scCs"x|D]}|j|�qWdS(s�Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R�(R%R�Rb((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytdeletemessages�s
ic
Cs�|r|jj|jj�nyd}|j|�}|j|�}|j�rd|j|�}n|j	||||�}|dkr�||kr�|j
||�|j|�n|j	||||�d|kr)t|_
q)nD|dkr|j|�n(td||j�|ftjj��Wn�tk
r@�n�tk
r�}	|	jtjjkrj�n|jj|	t�d�nCtk
r�}	|jj|	t�ddd||jf��nXdS(sCopies a message from self to dst if needed, updating the status

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.

        :param uid: uid of the message to be copied.
        :param dstfolder: A BaseFolder-derived instance
        :param statusfolder: A LocalStatusFolder instance
        :param register: whether we should register a new thread."
        :returns: Nothing on success, or raises an Exception.itSs@Trying to save msg (uid %d) on folder %s returned invalid uid %ditmsgsCopying message %s [acc: %s]N(RtregisterthreadRtaccountRR�R�R5RgR�R�R�R1RRR6RkRltKeyboardInterrupttseverityterrorRt	ExceptionR,(
R%Rbt	dstfolderR2tregistertmessageR�R�R�te((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt
copymessageto�s>
cst|_g}t�fd�|j��}t|�}|rz|jjjrz|jj	dj
|||j|j��dSx>t|�D]0\}}tj
jjj�r�Pn|dkr|j|�r|j|�}|j|�}	�j|d||	�q�n|jj||d|||�|j�r�tjjr�|j�tj|j�d|jdd|j|fd	||�f�}
|
j �|j!|
�q�|j||�d
d�q�Wx|D]}
|
j"�q�W|jr�|j#dkr�|j#�q�ndS(s�Pass1: Copy locally existing messages not on the other side.

        This will copy messages to dstfolder that exist locally but are
        not in the statusfolder yet. The strategy is:

        1) Look for messages present in self but not in statusfolder.
        2) invoke copymessageto() on those which:
           - If dstfolder doesn't have it yet, add them to dstfolder.
           - Update statusfolder

        This function checks and protects us from action in dryrun mode.cs�j|�S(N(Rd(Rb(R2(s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt<lambda>Mss/[DRYRUN] Copy {0} messages from {1}[{2}] to {3}NiittargetRsCopy message from %s:%stargsR�($RRtfilterReR\RR�tdryrunRtinfotformatt	enumeratetofflineimaptaccountstAccounttabort_NOW_signaltis_setRdR�R�R�RtcopyingmessageR.RtoptionstsinglethreadingR0RtInstanceLimitedThreadR4R�tstartR�RIR(R%R�R2tthreadstcopylisttnum_to_copytnumRbR�R�tthread((R2s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__syncmessagesto_copy;sD	 
	

	cs�t�fd�|j��}t|�r�|j|�t�fd�|�}t|�r��jj|�g��jjjr�dS�j|�q�ndS(s$Pass 2: Remove locally deleted messages on dst.

        Get all UIDS in statusfolder but not self. These are messages
        that were deleted in 'self'. Delete those from dstfolder and
        statusfolder.

        This function checks and protects us from action in dryrun mode.
        cs|dko�j|�S(Ni(Rd(Rb(R%(s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyR�scs
�j|�S(N(Rd(Rb(R�(s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyR��sN(	R�ReR\R�RtdeletingmessagesRR�R�(R%R�R2t
deletelist((R�R%s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__syncmessagesto_deleteus

c
Cs�t|j|��}y�|j�j�}|dkr:|St|j��}|j|�}||ks�t||�}||M}|jj	d|�ntg|D]}||^q��}	||	O}Wnt
k
r�nX|S(s^Combine the message's flags and keywords using the mapping for the
        destination folder.sXUnknown keywords skipped: %s
You may want to change your configuration to include those
N(tsetR�R8t
getkeywordmapRR^R�tlistRtwarnR/(
R%RbR�t	selfflagst
keywordmapt
knownkeywordstselfkeywordstskipped_keywordstkeywtkeywordletterset((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytcombine_flags_and_keywords�s"
#
cCs�i}i}x�|j�D]�}|dks|j|�rAqn|j|�rb|j|�}n	t�}|j||�}||}||}	x8|D]0}
|
|kr�g||
<n||
j|�q�Wx8|	D]0}
|
|kr�g||
<n||
j|�q�WqWxq|j�D]c\}
}|jj||
|�|j	j
jrOqn|j|t|
��|j|t|
��qWxq|j�D]c\}
}|jj
||
|�|j	j
jr�q�n|j|t|
��|j|t|
��q�WdS(sWPass 3: Flag synchronization.

        Compare flag mismatches in self with those in statusfolder. If
        msg has a valid UID and exists on dstfolder (has not e.g. been
        deleted there), sync the flag change to both dstfolder and
        statusfolder.

        This function checks and protects us from action in ryrun mode.
        iN(ReRdR�R�R�R�titemsRtaddingflagsRR�R�R�t
deletingflagsR�(R%R�R2taddflaglisttdelflaglistRbtstatusflagsR�taddflagstdelflagstflagtuids((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__syncmessagesto_flags�s>	





cCs�x�|jD]�\}}tjjjj�r/Pny|||�Wq
tk
rV�q
tk
r�}|jtj	j
kr��n|jj|t
�d�q
tk
r�}|jj|t
�dd||jf��q
Xq
WdS(s�Syncs messages in this folder to the destination dstfolder.

        This is the high level entry for syncing messages in one direction.
        Syncsteps are:

        Pass1: Copy locally existing messages
         Copy messages in self, but not statusfolder to dstfolder if not
         already in dstfolder. dstfolder might assign a new UID (e.g. if
         uploading to IMAP). Update statusfolder.

        Pass2: Remove locally deleted messages
         Get all UIDS in statusfolder but not self. These are messages
         that were deleted in 'self'. Delete those from dstfolder and
         statusfolder.

         After this pass, the message lists should be identical wrt the
         uids present (except for potential negative uids that couldn't
         be placed anywhere).

        Pass3: Synchronize flag changes
         Compare flag mismatches in self with those in statusfolder. If
         msg has a valid UID and exists on dstfolder (has not e.g. been
         deleted there), sync the flag change to both dstfolder and
         statusfolder.

        Pass4: Synchronize label changes (Gmail only)
         Compares label mismatches in self with those in statusfolder.
         If msg has a valid UID and exists on dstfolder, syncs the labels
         to both dstfolder and statusfolder.

        :param dstfolder: Folderinstance to sync the msgs to.
        :param statusfolder: LocalStatus instance to sync against.
        isSyncing folder %s [acc: %s]N(R$R�R�R�R�R�R�RR�RktFOLDERRR�RR�R,(R%R�R2tpassdesctactionR�((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pytsyncmessagesto�s#
cCs2t|t�r||jkSt|�t|�kS(soComparisons work either on string comparing folder names or
        on the same instance.

        MailDirFolder('foo') == 'foo' --> True
        a = MailDirFolder('foo'); a == b --> True
        MailDirFolder('foo') == 'moo' --> False
        MailDirFolder('foo') == IMAPFolder('foo') --> False
        MailDirFolder('foo') == MaildirFolder('foo') --> False
        (t
isinstancet
basestringRtid(R%tother((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__eq__"s
cCs|j|�S(N(R(R%R((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt__ne__1s(It__name__t
__module__R)R*R+tpropertyR,R-R	R.R0R3R4R5R6R7R8R9RR;RBRFRKRCRERDR[R_R`RaRcRdReRfRgRsRvRyR~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R!R"R�R#R
RR(((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyRs�	8																																					
								
								
					g				#			E	:		'	8	4	(tos.pathRGR?RmtsysRR�RRtofflineimap.uiRtofflineimap.errorRtofflineimap.accountstobjectR(((s;/usr/lib/python2.7/site-packages/offlineimap/folder/Base.pyt<module>s

Spamworldpro Mini