KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/mercurial/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/mercurial/mail.pyc
�
Hq�Qc@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddl
ZddlZejjjZd�Zeejjjd<dejfd��YZejejd�rdejfd	��YZnddd
�Zd�Zd�Zd
�Zdd�Zdd�Zd�Zded�Z d�Z!d�Z"d�Z#ded�Z$dd�Z%ded�Z&ded�Z'ded�Z(dS(i����(t_NcOsd|d<t|||�dS(s�
    Python 2.7 introduces a backwards incompatible change
    (Python issue1974, r70772) in email.Generator.Generator code:
    pre-2.7 code passed "continuation_ws='	'" to the Header
    constructor, and 2.7 removed this parameter.

    Default argument is continuation_ws=' ', which means that the
    behaviour is different in <2.7 and 2.7

    We consider the 2.7 behaviour to be preferable, but need
    to have an unified behaviour for versions 2.4 to 2.7
    t tcontinuation_wsN(t_oldheaderinit(tselftargstkw((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt_unifiedheaderinits
t__init__tSTARTTLScBs&eZdZd�Zddd�ZRS(s�Derived class to verify the peer certificate for STARTTLS.

    This class allows to pass any keyword arguments to SSL socket creation.
    cKs tjj||�||_dS(N(tsmtplibtSMTPRt
_sslkwargs(Rt	sslkwargstkwargs((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR&scCs�|jd�s'd}tj|��n|jd�\}}|dkr�tj|j|||j�|_tj	|jd�s�|jj
|j_ntj|j�|_
d|_d|_i|_d|_n||fS(Ntstarttlss*STARTTLS extension not supported by serverR	i�treadi(thas_extnR
t
SMTPExceptiontdocmdtsslutiltssl_wrap_sockettsockRtutiltsafehasattrtrecvRtSSLFakeFiletfiletNonet	helo_respt	ehlo_resptesmtp_featurest
does_esmtp(Rtkeyfiletcertfiletmsgtresptreply((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR*s			N(t__name__t
__module__t__doc__RRR(((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR	!s	t_get_sockettSMTPScBs&eZdZddd�Zd�ZRS(s�Derived class to verify the peer certificate for SMTPS.

        This class allows to pass any keyword arguments to SSL socket creation.
        cKs>||_||_tjj||�tj|_||_dS(N(R!R"R
RRt
SMTP_SSL_PORTtdefault_portR(RR
R!R"R((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyRBs
		cCsz|jdkr+tjdI||fIJntj||f|�}tj||j|j|j	�}t
j|�|_|S(Nisconnect:(
t
debugleveltsyststderrtsockettcreate_connectionRRR!R"RR
RR(Rthosttportttimeoutt
new_socket((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR)Is	N(R&R'R(RRR)(((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR*=scKstjtd���dS(Ns"SMTPS requires Python 2.6 or later(RtAbortR(R
R!R"R((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR*Sscs1|jdd�}|jddd�}|dkp?tj|�}|dk}|sZ|r�tjtd�r�tjtd���n|jdd	�}|s�tjtd
���n|jddd�}|dkr
tj|�tk	r
tjtd�|��q
n|s|r1|r1tj	||�}ni}|re|j
td��t|d|��n-|r�t|d|��nt
jd|��|r�d}nd}tj|jdd|��}	|j
td�||	f��jd	|d|	�|r2|j
td���j��j��j�n|s>|r||r||j
td��tj||��j|dk�n|jdd�}
|jdd�}|
r�|r�|j�}n|
r|r|j
td�|
�y�j|
|�Wqt
jk
r}tj|��qXn�fd�}
|
S(s;build an smtp connection and return a function to send mailtsmtptlocal_hostnamettlstnoneRtsmtpstssls/can't use TLS: Python SSL support not installedR2s+smtp.host not configured - cannot send mailt
verifycerttstricttlooses)invalid smtp.verifycert configuration: %ss(using smtps)
i�iR3s$sending mail: smtp host %s, port %s
s(using starttls)
s(verifying remote certificate)
tusernametpasswords&(authenticating to mail server as %s)
cs�y�j|||�SWn|tjk
rq}g|jj�D]}|d^q<}tjddj|���n%tjk
r�}tj|��nXdS(Nis
(	tsendmailR
tSMTPRecipientsRefusedt
recipientstvaluesRR6tjoinR(tsenderRDR#tinsttr(ts(s4/usr/lib64/python2.7/site-packages/mercurial/mail.pytsend�s&(sstrictR?(tconfigRt	parseboolRR0R6RtFalseRR
tnoteR*R	R
RtgetporttconnecttehloRt	validatorRtgetpasstloginR(tuiR8R9RR;tmailhostR=R
tdefaultporttmailportR@RARHRK((RJs4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt_smtpVsf	


%
	cCs�|jdd�}d|tj|�djttj|��f}|jtd�|�tj|d�}|j|�|j	�}|r�tj
dtjj
|jd
d�d	�tj|�d	f��nd
S(ssend mail using sendmail.temailtmethods%s -f %s %sRssending mail: %s
tws%s %siiN(RLRR[RFtmapRORtpopentwritetcloseR6tostpathtbasenametsplitRtexplainexit(RVRGRDR#tprogramtcmdlinetfptret((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt	_sendmail�s
	cCsft|d�}tjdtj��}|jd||f�|j|�|jd�|j�dS(swrite mails to mboxsab+s%a %b %d %H:%M:%S %YsFrom %s %s
s

N(topenttimetstrftimet	localtimeR`Ra(tmboxRGRDR#Ritdate((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt_mbox�s

csX�r&t�d�j��fd�S�jddd�dkrKt��S�fd�S(snmake a mail connection. return a function to send mail.
    call as sendmail(sender, list-of-recipients, msg).twbcst�|||�S(N(Rr(RJRItm(Rp(s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt<lambda>�sR[R\R7cst�|||�S(N(Rk(RJRIRt(RV(s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyRu�s(RlRaRLRZ(RVRp((RpRVs4/usr/lib64/python2.7/site-packages/mercurial/mail.pyRQ�s

cCs"t|d|�}||||�S(NRp(RQ(RVRGRDR#RpRK((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyRB�scCs}|jddd�}|dkrN|jdd�sytjtd���qyn+tj|�sytjtd�|��ndS(s=determine if we have enough config data to try sending email.R[R\R7R2s>smtp specified as email transport, but no smtp host configureds0%r specified as email transport, but not in PATHN(RLRR6Rtfindexe(RVR\((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pytvalidateconfig�stplaincCsod}|s_y|jd�Wq_tk
r[y|jd�d}Wq\tk
rWq\Xq_Xnt|||�S(s�Return MIME message suitable for a patch.
    Charset will be detected as utf-8 or (possibly fake) us-ascii.
    Transfer encodings will be used if necessary.sus-asciisutf-8(tdecodetUnicodeDecodeErrort
mimetextqp(RJtsubtypetdisplaytcs((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt
mimetextpatch�s



cCs~d}x?|j�D]1}t|�dkrtj|�}d}PqqWtjj|||�}|rz|d=||d<n|S(s[Return MIME message.
    Quoted-printable transfer encoding will be used if necessary.
    i�squoted-printablesContent-Transfer-EncodingN(Rt
splitlinestlentquopritencodestringR[tMIMEText(tbodyR|tcharsettenctlineR#((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyR{�s
cCs�g|jdd�D]}|j�^q}tjj�tjj�dg}x*|D]"}||krS|j|�qSqSWg|D]}|jd�s�|^q�S(s;Obtains charsets to send mail parts not containing patches.R[tcharsetssutf-8tascii(t
configlisttlowertencodingtfallbackencodingtappendtendswith(RVR~R�t	fallbacks((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt	_charsets�s+
cCs�y|jd�Wn�tk
r�|p0t|�}x�tjtjfD]�}y|j|�}Wntk
ruqFnXx`|D]X}y|j|�|fSWq}tk
r�q}tk
r�|jt	d�|�q}Xq}WqFWnX|dfS(sReturns (converted) string, charset tuple.
    Finds out best charset by cycling through sendcharsets in descending
    order. Tries both encoding and fallbackencoding for input. Only as
    last resort send as is in fake ascii.
    Caveat: Do not use for mail parts containing patches!R�s!ignoring invalid sendcharset: %s
sus-ascii(
RyRzR�R�R�tencodetUnicodeEncodeErrortLookupErrortwarnR(RVRJR�tsendcharsetsticstutocs((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt_encode�s"




'cCs;|s7t|||�\}}ttjj||��S|S(s4Returns RFC-2047 compliant header from given string.(R�tstrR[tHeader(RVRJR�R}R~((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt
headencodescCs�t|||�}yS|jd�\}}|jd�}|jtj�jd�}d||f}Wnztk
r�tjtd�|��nQt	k
r�y|jd�}Wq�tk
r�tjtd�|��q�XnXt
jj||f�S(Nt@R�tidnas%s@%ssinvalid email address: %ssinvalid local address: %s(
R�ReR�RyR�RzRR6Rt
ValueErrorR[tUtilst
formataddr(RVtnametaddrR�tacctdom((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt_addressencodes


!cCsB|s
|r|pdStjj|�\}}t||||�S(s-Turns address into RFC-2047 compliant header.t(R[R�t	parseaddrR�(RVtaddressR�R}R�R�((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt
addressencode,s

cCs�|r/g|D]}|j�r
|j�^q
Sg}xKtjj|�D]7\}}|s`|rH|jt||||��qHqHW|S(s�Turns a list of addresses into a list of RFC-2047 compliant headers.
    A single element of input list may contain multiple addresses, but output
    always has one address per item(tstripR[R�tgetaddressesR�R�(RVtaddrsR�R}tatresultR�R�((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pytaddrlistencode3s)#cCs7d}|s't|||�\}}nt|d|�S(sgcreates mime text object, encodes it if needed, and sets
    charset and transfer-encoding accordingly.sus-asciiRx(R�R{(RVRJR�R}R~((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt
mimeencode@s()ti18nRRR�RRbR
R0R�RmR.temail.HeaderR[temail.MIMETexttemail.UtilsR�RRRt__dict__RR	RR*RRZRkRrRQRBRwRNRR{R�R�R�R�R�R�R�(((s4/usr/lib64/python2.7/site-packages/mercurial/mail.pyt<module>s2$H$		C		
			
	

Anon7 - 2021