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/GmailMaildir.pyo
�
��Vc@srddlZddlmZddlmZddlmZddlZddlmZdefd��YZ	dS(	i����N(texc_infoi(t
MaildirFolder(tOfflineImapError(timaputiltGmailMaildirFoldercBsweZdZd�Zd�Zd�Zddd�Zd�Zd�Z	d�Z
e�d�Zd	d
�Z
d�ZRS(
sMFolder implementation to support adding labels to messages in a Maildir.
    cCs~tt|�j||||�|jjjdd�|_|jjjdd�|_|jrz|j	j
d|jf�ndS(Ntlabelsheaders
X-Keywordst
synclabelsissyncing labels(tsuperRt__init__t
repositorytaccounttgetconfRtgetconfbooleanRtsyncmessagesto_passestappendtsyncmessagesto_labels(tselftroottnametsepR	((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyRs
	cCs�|j�t|j��t|j��kr2tSx=|j�j�D])\}}|d|j|�krEtSqEWx=|j�j�D])\}}|d|j|�kr�tSq�WtS(sFReturns True if the Maildir has changed. Checks uids, flags and mtimestflagstmtime(	tcachemessagelisttsortedtgetmessageuidlisttTruetgetmessagelistt	iteritemstgetmessageflagstgetmessagemtimetFalse(Rtstatusfoldertuidtmessage((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pytquickchanged*s
cCs-it�d6t�d6td6dd6dd6S(NRtlabelst
labels_cacheds/no-dir/no-such-file/tfilenameiR(tsetR(RR ((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pytmsglist_item_initializer>scCs�|j�r*|jd|d|�|_n|jr�x[|jj�D]G\}}tjj|j�|d�}t	tj
|�j�|d<qCWndS(Ntmin_datetmin_uidR%R(tismessagelistemptyt_scanfoldertmessagelistRtitemstostpathtjointgetfullnametlongtstattst_mtime(RR(R)R tmsgtfilepath((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyRCs	cCs�|j|ds�|j|d}tjj|j�|�}tjj|�sVt�St|d�}|j�}|j	�t�|j|d<xD|j
||j�D]-}|j|djt
j|j|��q�Wt|j|d<n|j|dS(NR$R%trtR#(R,R.R/R0R1texistsR&topentreadtclosetgetmessageheaderlistRtupdateRtlabels_from_headerR(RR R%R6tfiletcontentthstr((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pytgetmessagelabelsNs
cCs*d|j|krdS|j|dSdS(NRi(R,(RR ((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyRdsc
Cs�|js(tt|�j||||�St�}x9|j||j�D]"}|jtj	|j|��qGWtt|�j||||�}|j
|d}tjj
|j�|�}	ttj|	�j�|j
|d<||j
|d<|S(s�Writes a new message, with the specified uid.

        See folder/Base for detail. Note that savemessage() does not
        check against dryrun settings, so you need to ensure that
        savemessage is never called in a dryrun mode.R%RR#(RRRtsavemessageR&R<RR=RR>R,R.R/R0R1R2R3R4(
RR R@RtrtimeR#RAtretR%R6((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyRCjs		 !#cCs*|j|d}tjj|j�|�}t|d�}|j�}|j�t�}x9|j	||j
�D]"}	|jtj
|j
|	��qpW||}||@}
||}||kr�dStj|j
t||
B��}|j||j
�}|j|d|j
|�}ttj|�j�}|j|t��}
|j|
|�}tjj|j�|�}ytj||�WnFtk
r�}td|||dftjj�dt�d�nX|jr�|r�tj|||f�nttj|�j�|j|d<||j|d	<dS(
s�Change a message's labels to `labels`.

        Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a dryrun mode.R%R7Ns
s"Can't rename file '%s' to '%s': %siiRR#( R,R.R/R0R1R9R:R;R&R<RR=RR>tformat_labels_stringRtdeletemessageheaderstaddmessageheaderR2R3R4tnew_message_filenametsave_to_tmp_filetrenametOSErrorRtERRORtFOLDERtNoneRtutime_from_headertutime(RR R#tignorelabelsR%R6R?R@t	oldlabelsRAt
ignoredlabelst
labels_strRtmessagenamettmpnamettmppathte((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pytsavemessagelabels�s>
	 


#icCs�|dko|j|�}tt|�j||||�|r�|jr�y2|j|�}|j||d|j|��Wq�tk
r�dSXndS(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.iRN(	t	uidexistsRRt
copymessagetoRRBRZRtNotImplementedError(RR t	dstfolderRtregistertrealcopyR#((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyR\�s#
cCs�i}i}g}yhx�|j�D]�}tjjjj�rAPn|dks"|j|�rcq"n|j|�}|j|�r�|j|�}nd}||kr"|j|�q"q"W|j	j
||�x�|D]�}tjjjj�r�Pn|j|�}	|j|�r"|j|�}
n	t�}
|	|
}|
|	}x8|D]0}
|
|kreg||
<n||
j|�qFWx8|D]0}
|
|kr�g||
<n||
j|�q�Wq�Wx�|j
�D]�\}
}tjjjj�r�Pn|j	j||
|�|jjjrq�n|j|t|
g��|j|t|
g��q�Wx�|j
�D]�\}
}tjjjj�r~Pn|j	j||
|�|jjjr�qYn|j|t|
g��|j|t|
g��qYWi}x�|D]|}tjjjj�rPn|jjjr q�n|j|d}tjj|j�|�}ttj|�j�||<q�W|j|�Wn!tk
r�|j	jd�nXdS(s�Pass 4: Label Synchronization (Gmail only)

        Compare label 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 labels change to both dstfolder and
        statusfolder.

        Also skips messages whose mtime remains the same as statusfolder, as the
        contents have not changed.

        This function checks and protects us from action in ryrun mode.
        iR%sKCan't sync labels. You need to configure a remote repository of type Gmail.N( RtofflineimaptaccountstAccounttabort_NOW_signaltis_setR[RRtuitcollectingdataRBR&R-taddinglabelsR	R
tdryruntaddmessageslabelstdeletinglabelstdeletemessageslabelsR,R.R/R0R1R2R3R4tsavemessagesmtimebulkR]twarn(RR^RtaddlabellisttdellabellisttuidlistR t	selfmtimetstatusmtimet
selflabelststatuslabelst	addlabelst	dellabelstlbtuidstmtimesR%R6((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyR�sz
	






 
N(t__name__t
__module__t__doc__RR"R'RORRBRRCR&RZR\R(((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyRs	
					8 (
R.tsysRtMaildirRRaRtofflineimap.accountsRR(((sC/usr/lib/python2.7/site-packages/offlineimap/folder/GmailMaildir.pyt<module>s

Spamworldpro Mini