%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/lib/mailman/Mailman/
Upload File :
Create Path :
Current File : //proc/self/root/lib/mailman/Mailman/Utils.pyc

�
��acx@sPdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlmZddlmZddlmZmZyddlmZWn'ek
rdZeej�ZnXdd	lmZdd
lmZddlmZddlm Z dd
l!m"Z"y"ddl#Z#e#j$Z%e#j&Z'Wn;ek
r�ddl$Z$ddl(Z(e$j)Z%e(j)Z'nXye*e+fWne,k
r�dZ*dZ+nXy2ddl-Z.ddl/Z.ddl0m1Z1e*Z2Wnek
rCe+Z2nXdZ3dZ4dZ5dZ6eedZ7ej8dej9�Z:ej8dej9�Z;d�Z<d�Z=de*d�Z>d�Z?d�Z@d�ZAej8d�ZBej8d ej9�ZCd!�ZDej8d"�ZEd#d$�ZFde+d%�ZHd&�ZIe+d'�ZJd�ZKd�ZLgZMxAeKD]9ZNx0eLD](ZOeMjPeOeN�eMjPeNeO�qbWqUW[O[Nd>�ZQd?�ZRejSd@�ZTdA�ZUe*dB�ZVe*dC�ZWe*dD�ZXej8dEej9�ZYdF�ZZdG�Z[e+dH�Z\dI�Z]dJe^fdK��YZ_de+dddL�Z`de+dddM�Zaid�dN6d�dO6d�dP6d�dQ6d�dR6d�dT6d�dU6d�dW6d�dX6d�dY6d�dZ6Zbd[�Zcde*d\�Zdde+d]�Zed^�Zfd_�Zgd`�Zhda�Zidb�Zjdddc�Zkdaldd�Zmdde�Zndf�Zodg�Zpdh�Zqdi�Zrddj�Zsddk�Ztdl�Zudm�Zvdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�gxZwej8d�jxew�ej9�Zyej8d��Zzej8d�ej9�Z{d��Z|d��Z}d��Z~dS(�s�Miscellaneous essential routines.

This includes actual message transmission routines, address checking and
message and address munging, a handy-dandy routine to map a function on all
the mailing lists, and whatever else doesn't belong elsewhere.

i����(t
nested_scopesN(tHeaderParseError(tUnicodeType(t
whitespacetdigits(t
ascii_letterstabcdefghijklmnopqrstuvwxyz(tmm_cfg(tErrors(tSite(tSafeDict(tsyslogii(tDNSExceptiontus
t.t_s%\(([_a-z]\w*?)\)s?s%(\${2})|\$([_a-z]\w*)|\${([_a-z]\w*)}cCs�ttjtjd|��dkr8tdd|�tStj|�}x=d
D]5}t	j
j|d	|�}t	j
j|�rNt
SqNWtS(s'Return true iff list `listname' exists.R
itmischiefsHostile listname: %ss.pcks	.pck.lasts.dbs.db.lasttconfig(s.pcks	.pck.lasts.dbs.db.last(tlentretsubRtACCEPTABLE_LISTNAME_CHARACTERSRtFalseR	tget_listpathtostpathtjointexiststTrue(tlistnametbasepathtexttdbfile((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytlist_exists`s
$
cCs
tj�S(s8Return the names of all lists in default list directory.(R	t
get_listnames(((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
list_namesusiFc	Cszd}tjd|�}xW|D]O}g}t}x�|jt�D]�}|s`|j|�qAn|r|dtkrt}	nt}	|r�|	r�|dj�d||d<n
|j|�|	}qAWx�|D]�}x|rUt|�|kr�|}d}nJ|}
x*|
dkr0||
tkr0|
d8}
qW|
}x*|dkrc||tkrc|d8}q:W|dkr�|}x0|t|�kr�||tkr�|d7}qyW|}
x0|
t|�kr�||
tkr�|
d7}
q�W|
d8}
n||d d}|
d7}
x0|
t|�kr=||
tkr=|
d7}
qW||
}||7}q�W|d7}q�W|d7}qW|d S(	s�Wrap and fill the text to the specified column.

    Wrapping is always in effect, although if it is not possible to wrap a
    line (because some word is longer than `column' characters) the line is
    broken at the next available whitespace boundary.  Paragraphs are also
    always filled, unless honor_leading_ws is true and the line begins with
    whitespace.  This is the algorithm that the Python FAQ wizard uses, and
    seems like a good compromise.

    R
s

ii����t is
i����(	RtsplitRtNLtappendRRtrstripR(ttexttcolumnthonor_leading_wstwrappedtparastparatlinestfillprevtlinetfillthistbolteol((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytwrap}sX

	


		%%

%
cCs"d}d}|j|j|��S(Ns
 .
s
.
(RR%(R)tJOINERtSEP((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytQuotePeriods�scCsnd}d}|j�}|jd�}|dkr=|dfS|| }||d}|jd�}||fS(Nt@iR(tNonetlowertfindR%(temailtusertdomaintat_signtrest((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
ParseEmail�s

cCs=|jd�}|dkr|S|| d||dj�S(s3returns the address with the domain part lowercasedR9i����i(R<R;(taddrtatind((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytLCDomain�ss"[][()<>|:;^,\\"\000-\037\177-\377]s	[-a-z0-9]cCs�|s|jd�dkr(tj�ntj|�sG|ddkrVtj|�nt|�\}}|s}tj|�nt|�dkr�tj|�nx;|D]3}ttj	d|��dkr�tj|�q�q�WdS(s0Verify that an email address isn't grossly evil.R$it-iR
N(
tcountRtMMBadEmailErrort	_badcharstsearchtMMHostileAddressRBRt
_valid_domainR(tsR>tdomain_partstp((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
ValidateEmail�s
s[^\x21-\x7e]t	PATH_INFOcCs3tjj|�}|r/tjjdtjjdtjjdd���}tj|�r}tj|�d}tdd�ng|jd�D]}|r�|^q�}t�r�tgt�D]}t	|�^q��}nd	}|r+t	|d�|kr+td
d|d|�|d| d|d<n|SdS(
NtHTTP_FORWARDED_FORtHTTP_X_FORWARDED_FORtREMOTE_ADDRsunidentified originiterrors(Warning: Possible malformed path attack.t/iRs(Hostile listname: listname=%s: remote=%ss...(RtenvirontgettCRNLpatRJR%RR#tmaxRR:(tenvarRtremoteROtpiecestxtlongest((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
GetPathPiecess&(	+cCs&|dkr<tjt�}|ddkr<|d}q<ntjjd�}|dkr�tjjdd�tjjdd�}ntj|�d}|r|j|�r|t	|�}|j
d�}|d	kr�|jdd	|�}n|jd�}d
||}n
||}|tjS(s�target - scriptname only, nothing extra
    web_page_url - the list's configvar of the same name
    absolute - a flag which if set, generates an absolute url
    i����RVtREQUEST_URItSCRIPT_NAMER
RQit?is../N(
R:RtDEFAULT_URL_PATTERNt
get_domainRRWRXturlparset
startswithRR<RGtCGIEXT(ttargettweb_page_urltabsolutetfullpathtbaseurltiRGR((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt	ScriptURLs$
cCs�|j�}t|�\}}|g}|r}|d}xCt|�dkry|jd|tj|�f�|d}q:Wn|S(sreturns a sorted list of addresses that could possibly match
    a given name.

    For Example, given scott@pobox.com, return ['scott@pobox.com'],
    given scott@blackbox.pobox.com return ['scott@blackbox.pobox.com',
                                           'scott@pobox.com']iis%s@%s(R;RBRR'tDOTR(tnameR>R?tres((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytGetPossibleMatchingAddrs:s	
 cCsOi}|r0x<|D]}t||j�<qWnx|D]}t||<q7W|S(s<Return a dict keyed by the entries in the list passed to it.(RR;(tLtfoldcasetdRn((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt	List2DictNs

tateRntotutbtcRvtftgthtktmtnROtrRMtttvtwR^tzcCsJg}x0t|�d|kr8|jtjt��q	Wtj|�| S(Ni(RR'trandomtchoicet
_syllablestEMPTYSTRINGR(tlengthtsyls((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytUserFriendly_MakeRandomPasswordfscCsGd}g}d}zx�||kr�ytj||�}Wn�ttfk
r�|dkr�ytjdtj�}Wq�tk
r�}|jtj	kr��nt
dd�t|�SXntj|||�}nX|j
|�|t|�7}qWtjtj|��}|jdd�| SWd|dk	rBtj|�nXdS(Nis/dev/urandomRUs+urandom not available, passwords not secures
R
(R:RturandomtAttributeErrortNotImplementedErrortopentO_RDONLYtOSErrorterrnotENOENTRR�treadR'Rtbase64tencodestringR�Rtreplacetclose(R�t	bytesreadtbytestfdtnewbytesRyRM((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytSecure_MakeRandomPasswordms0
cCstjrt|�St|�S(N(RtUSER_FRIENDLY_PASSWORDSR�R�(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytMakeRandomPassword�s	
cCsRttj�d�}ttj�d�}d�}dtt|||f��S(Ni4cSsVd|kodknr)|d7}nd|ko@dknrR|d7}n|S(NiiiAi4iG((R}((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytmkletter�s


s%c%c(tintR�ttupletmap(tchr1tchr2R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
GetRandomSeed�s	cCsy|rtj}n	tj}tjd�}z:t|d�}|jt|�j�d�|j	�Wdtj|�XdS(NiR�s
(
RtSITE_PW_FILEtLISTCREATOR_PW_FILERtumaskR�twritetsha_newt	hexdigestR�(tpwt	siteadmintfilenametomasktfp((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytset_global_password�s	cCsx|rtj}n	tj}y*t|�}|j�d }|j�Wn,tk
rs}|jtjkro�ndSX|S(Ni����(
RR�R�R�R�R�tIOErrorR�R�R:(R�R�R�t	challengeRy((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytget_global_password�s	cCs2t|�}|dkrdS|t|�j�kS(N(R�R:R�R�(tresponseR�R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytcheck_global_password�ss&amp;((?:#[0-9]+|[a-z]+);)cCsjtjrKt|t�rKx-tjD]}|j|tj|�}q"WqKntjdtj	|dt
��S(Ns&\1tquote(RtBROKEN_BROWSER_WORKAROUNDt
isinstancetstrtBROKEN_BROWSER_REPLACEMENTSR�t_ampreRtcgitescapeR(RMR�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytwebsafe�s
	#cCsa|jdd�}t|�dkrWy|dt|d�fSWqWtk
rSqWXn|dfS(Nt:iiiiw(R%RR�t
ValueError(RMtparts((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt	nntpsplit�s
cCs*|r|jdd�S|jdd�SdS(s�Make email address unrecognizable to web spiders, but invertable.

    When for_text option is set (not default), make a sentence fragment
    instead of a token.R9s at s--at--N(R�(RCtfor_text((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytObscureEmail�scCs|jdd�S(s!Invert ObscureEmail() conversion.s--at--R9(R�(RC((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytUnobscureEmail�st	OuterExitcBseZRS((t__name__t
__module__(((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyR��scCs�g}|dk	r"|j|�n|dk	rA|j|j�n|jtj�g}|dk	r�|j|j��|jtjjtj	|j
��n|jtjjtj	d��|jtj	�d}y�x�|D]y}xp|D]h}tjj|||�}	yt|	�}t�Wq�t
k
rN}
|
jtjkrE�nd}q�Xq�Wq�WWntk
rknX|dkr�y+tjjtj	d|�}	t|	�}Wq�t
k
r�}
|
jtjkr��nt
tjd|��q�Xn|j�}|j�|}|dk	r�y^t|�}
y|
j|�}Wn8tk
rmt|t|�d�}|
j|�}nXWq�ttfk
r�}
tdd|	|
�q�Xn|r�||	fSt|�|	fS(NtsitetensNo template file foundR�RUsbroken template: %s
%s(R:R'tpreferred_languageRtDEFAULT_SERVER_LANGUAGERlRRRtTEMPLATE_DIRt	host_nameR�R�R�R�R�R�R�R
tinterpolatetUnicodeErrortunicodet
GetCharSett	TypeErrorR�RR5(ttemplatefiletdicttrawtlangtmlistt	languagest
searchdirsR�tdirR�RyttemplateR)tsdictt	utemplate((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytfindtext�sf4%






cCst|||||�dS(Ni(R�(R�R�R�R�R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytmaketextgstconfirmthelptinfotliststoptionsitpasswordtremoveitsett	subscribetunsubscribetwhocCs�d}g}xctjj|�D]O}|dkr5Pn|j�rN|d7}n|tjkratS|j|�qWtj	|�}t
j|j�j��r�t
S|d }t|jdd��}|j|�x�|D]�}|j�s�q�ng|j�D]}|j�^q�}t
j|dd�\}	}
|	dkrM|
dkrMq�n|	t|d�kon|
knr�|ddkr�|ddkr�q�nt
Sq�WtS(
Nis-- iitsubjectR
R�itontoff(NN(R�R�(R=t	Iteratorstbody_line_iteratortstripRtDEFAULT_MAIL_COMMANDS_MAX_LINESRR'R&Rt	ADMINDATAthas_keyR;RR�RXR%R:R(tmsgtlinecntR/R1tbodytextt	bodylinesR�twordtwordstminargstmaxargs((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytis_administrivia~s8



%& cCs{|}tjjd�r(tjd}n?tjjd�rgtjjd�rgtjdtjd}n|rwt|�S|S(sReturn the full virtual path this CGI script was invoked with.

    Newer web servers seems to supply this info in the REQUEST_URI
    environment variable -- which isn't part of the CGI/1.1 spec.
    Thus, if REQUEST_URI isn't available, we concatenate SCRIPT_NAME
    and PATH_INFO, both of which are part of CGI/1.1.

    Optional argument `fallback' (default `None') is returned if both of
    the above methods fail.

    The url will be cgi escaped to prevent cross-site scripting attacks,
    unless `escape' is set to 0.
    RaRbRQ(RRWR�R�(tfallbackR�turl((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
GetRequestURI�s$
cCs�x�|r�|r|�nytjdtj�\}}Wn6tk
rp}|jtjkrb�n|j�PnX|dkr�y||=Wq�tk
r�q�Xn|rPqqWdS(Ni����i(RtwaitpidtWNOHANGR�R�tECHILDtcleartKeyError(tkidstfunctoncetpidtstatusRy((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytreap�s"	


cCstj|dS(Ni(RtLC_DESCRIPTIONS(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytGetLanguageDescr�scCstj|dS(Ni(RR(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyR��scCstj|dS(Ni(RR(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytGetDirection�scCstjj|�S(N(RRR�(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
IsLanguage�scCs�tjjdtjjd��}tjjd�}|rd|jd|�rd|t|�d }ntjr}|r}|j�Stjr�t	j	tj�dp�tj
}|j�SdS(Nt	HTTP_HOSTtSERVER_NAMEtSERVER_PORTR�i(RRWRXtendswithRRtVIRTUAL_HOST_OVERVIEWR;tDEFAULT_URLRftDEFAULT_URL_HOST(thosttportthostname((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyRe�s!
		cCs[|dkr*tjjt�t��}n|dkrGdtj|fSdtj||fS(Ns%s@%ss%s-%s@%s(R:Rt
VIRTUAL_HOSTSRXRetMAILMAN_SITE_LIST(Rtextra((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytget_site_email�s
cCs<dttj�tj�|j�|jf}td7a|S(Ns<mailman.%d.%d.%d.%s@%s>i(t_serialttimeRtgetpidt
internal_nameR�(R�tmsgid((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytunique_message_ids

cCs4|dkrtj�d }ntj|dd�S(Niiii����(i(iiiii(i����(R:R%t	localtimetmktime(tdate((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytmidnightscCs�|jdd�jdd�}tj|�}xqtdt|�d�D]W}||dr�||ddtkr�d||d	||<qFd||||<qFWtj|�S(
s$Convert from %-strings to $-strings.t$s$$s%%t%iiis${t}(R�tcreR%trangeRt
IDENTCHARSR�R(RMR�Rn((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt	to_dollar s&cCs�|jdd�jdd�}tj|�}x�tdt|�d�D]v}||d
k	rid||<qF||dd
k	r�d||dd||d<qFd||d	d||d	<qFWtjtd
|��S(s$Convert from $-strings to %-strings.R/s%%s$$R.iis%(s)siN(	R�tdreR%R2RR:R�Rtfilter(RMR�Rn((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
to_percent,s
!"cCs_i}xRtdgtj|�D]!\}}}|p=|p=d^q�D]}t||<qGW|S(s?Return the set (dictionary) of identifiers found in a $-string.N(R6R:R5tfindallR(RMRvRxR|R}Rq((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytdollar_identifiers:sGcCs.i}x!tj|�D]}t||<qW|S(s?Return the set (dictionary) of identifiers found in a %-string.(R1R8R(RMRvRq((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytpercent_identifiersBscsDg�tjd|�}�fd�}�fd�}x�tr0�j||jd���|sePn|jd�}|jd�r�y|t|d��Wq-tk
r��j|d|d��q-Xq9tj	j
|d	�}|jd�r|jd�r|t|dd
!��q9�j||��q9Wtj
��}|S(Ns&(?P<ref>[^;]+);cs�jt|��dS(N(R'tunichr(Rn(tnewparts(s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytappchrPscsYt|t�r|S�dkr(d}n!t��}|dkrId}nt||d�S(Ns
iso-8859-1sus-asciiR�(R�R�R:R�(RMtcharset(R�(s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt	tounicodeSs		it#it&t;Rci����(RR%RR'tpopRgR�R�thtmlentitydefst
entitydefsRXRR�R(RMR�R�R=R?trefR}tnewstr((R�R<s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytcanonstrMs(	
"cCs�|dkrd}n|dkr*d}nt|�}y3t|t�rU|j|�St||�}|SWntk
r�t|�SXdS(Nusus-ascii(R:R�R�RtencodeR�R�tuquote(RMR�R>R{((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
uncanonstr|s		

cCscg}xG|D]?}t|�}|dkr?|jd|�q
|j|�q
Wttj|��S(Nis&#%3d;(tordR'R�R�R(RMRxR}Rz((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyRJ�s
cCs�yStjjtjj|��}|j�}tj|j��}|j|d�SWn-t	t
ttfk
r�t
j|j��SXdS(NR�(R=tHeadertmake_headert
decode_headert__unicode__tUEMPTYSTRINGRt
splitlinesRItLookupErrorR�R�RR�(RMtcsetR�tustrR1((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytoneline�ss<i?frames2<link(?! rel="SHORTCUT ICON" href="<mm-favicon>">)s<metas<objects<scripts
@keyframess\bj(?:ava)?script\bs\bvbs(?:cript)?\bs\bdomactivate\bs\bdomattrmodified\bs\bdomcharacterdatamodified\bs\bdomfocus(?:in|out)\bs\bdommenuitem(?:in)?active\bs\bdommousescroll\bs$\bdomnodeinserted(?:intodocument)?\bs#\bdomnoderemoved(?:fromdocument)?\bs\bdomsubtreemodified\bs
\bfscommand\bs\bonabort\bs\bon(?:de)?activate\bs\bon(?:after|before)print\bs\bon(?:after|before)update\bs+\b(?:on)?animation(?:end|iteration|start)\bs8\bonbefore(?:(?:de)?activate|copy|cut|editfocus|paste)\bs\bonbeforeunload\bs\bonbegin\bs
\bonblur\bs\bonbounce\bs\bonbroadcast\bs\boncanplay(?:through)?\bs\bon(?:cell)?change\bs\boncheckboxstatechange\bs\bon(?:dbl)?click\bs\bonclose\bs\boncommand(?:update)?\bs\boncomposition(?:end|start)\bs\boncontextmenu\bs\boncontrolselect\bs
\boncopy\bs	\boncut\bs\bondataavailable\bs!\bondataset(?:changed|complete)\bs5\bondrag(?:drop|end|enter|exit|gesture|leave|over)?\bs\bondragstart\bs
\bondrop\bs\bondurationchange\bs
\bonemptied\bs\bonend(?:ed)?\bs\bonerror(?:update)?\bs\bonfilterchange\bs\bonfinish\bs\bonfocus(?:in|out)?\bs
\bonhelp\bs\boninput\bs\bonkey(?:up|down|press)\bs\bonlayoutcomplete\bs\bon(?:un)?load\bs\bonloaded(?:meta)?data\bs\bonloadstart\bs\bonlosecapture\bs\bonmedia(?:complete|error)\bs
\bonmessage\bs6\bonmouse(?:down|enter|leave|move|out|over|up|wheel)\bs\bonmove(?:end|start)?\bs\bon(?:off|on)line\bs
\bonopen\bs\bonoutofsync\bs\bonoverflow(?:changed)?\bs\bonpage(?:hide|show)\bs\bonpaint\bs\bonpaste\bs\bonpause\bs\bonplay(?:ing)?\bs\bonpopstate\bs*\bonpopup(?:hidden|hiding|showing|shown)\bs\bonprogress\bs\bonpropertychange\bs\bonradiostatechange\bs\bonratechange\bs\bonreadystatechange\bs\bonrepeat\bs\bonreset\bs\bonresize(?:end|start)?\bs\bonresume\bs
\bonreverse\bs'\bonrow(?:delete|enter|exit|inserted)\bs#\bonrows(?:delete|enter|inserted)\bs\bonscroll\bs\bonsearch\bs\bonseek(?:ed|ing)?\bs\bonselect(?:start)?\bs\bonselectionchange\bs
\bonshow\bs\bonstart\bs
\bonstalled\bs
\bonstop\bs
\bonstorage\bs\bonsubmit\bs
\bonsuspend\bs\bonsync(?:from|to)preference\bs\bonsyncrestored\bs
\bontext\bs\bontime(?:error|update)\bs\bontoggle\bs$\bontouch(?:cancel|end|move|start)\bs\bontrackchange\bs\b(?:on)?transitionend\bs\bonunderflow\bs
\bonurlflip\bs\bonvolumechange\bs
\bonwaiting\bs\bonwheel\bs\bseeksegmenttime\bs\bsvgabort\bs\bsvgerror\bs\bsvgload\bs
\bsvgresize\bs
\bsvgscroll\bs
\bsvgunload\bs\bsvgzoom\bt|s
[-	--�]s,(&#[0-9]+;?)|(&#x[0-9a-f]+;?)|(%[0-9a-f]{2})cCs�|j�j�jd�}yG|jd�s<|jd�rRt|dd�}nt|d�}Wntk
rvdSX|dkr�t|�SdSd	S(
s=Translate &#... and %xx encodings into the encoded character.s&#;R^R/iii
R
iN(tgroupR;R�RgR�R�tchr(tmotmatchtval((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt
_translate9s

cCs3tjtjdtjt|���r+tStSdS(sWCheck HTML string for various tags, script language names and
    'onxxx' actions that can be used in XSS attacks.
    Currently, this a very simple minded test.  It just looks for
    patterns without analyzing context.  Thus, it potentially flags lots
    of benign stuff.
    Returns True if anything suspicious found, False otherwise.
    R
N(t_badhtmlRJt_filtercharsRt
_encodedcharsR]RR(thtml((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytsuspiciousHTMLIs	c
Cssts
tS|j�}|jd�}|dkr5tSd||d}yOtjj�}ttj	�|_
ttj�|_|j
|tjj�}WnPtjjtjjfk
r�tStk
r�}tdd|||j�tSXd}i}i}	t|dg�}
x�|jjD]�}|jtjjkr\|jdjj�|	|jj�<n|jtjjkrwqn|j|jj�g�jdj |jdj!��qWt"|
�}t|�}
x~|rH|j#d�}||	kr�|	||
krq�n|j|	|�|
j$|	|�|
j$|	|�|
j%|�q�q�Wt&|
�dkrntdd	|�nx�|
D]�}||kr�qunt'd
�||�}t&|�dkr�tSt&|�dkr�tdd|t&t(��nx�|D]y}t)j*d|t)j+�r)td
d||||�t,S|j-r�t)j*d|t)j+�r�td
d||||�t,Sq�WquWtS(NR9is_dmarc.RUs:DNSException: Unable to query DMARC policy for %s (%s). %sR
RisYmultiple DMARC entries in results for %s,
                   processing each to be strictcSs
|jd�S(Ns	v=DMARC1;(Rg(R�((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt<lambda>�ss\RRset of TXT records for %s has %d v=DMARC1 entries;
                       testing them alls\bp=reject\btvettes2DMARC lookup for %s (%s) found p=reject in %s = %ss\bp=quarantine\bs6DMARC lookup for %s (%s) found p=quarantine in %s = %s(.tdns_resolverRR;R<tdnstresolvertResolvertfloatRtDMARC_RESOLVER_TIMEOUTttimeouttDMARC_RESOLVER_LIFETIMEtlifetimetqueryt	rdatatypetTXTtNXDOMAINtNoAnswerRRt	__class__R�R�tanswertrdtypetCNAMEtitemsRitto_textRqt
setdefaultR'RtstringstlistRCtaddtdiscardRR6tdmarcRRJt
IGNORECASERt"dmarc_quarantine_moderation_action(R�R=R@tdmarc_domainRgttxt_recsRytfull_recordtresults_by_nametcnamest
want_namesttxt_rectexpandstseentitemRqtdmarcstentry((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pytIsDMARCProhibited]s�&	

	

	(RxRyRnRzR{(R|R}RvR~RR�R�R�R�ROR�RMR�R�R�R^R�(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(t__doc__t
__future__RRtsysRR�R%R�R�R�RfRDtemail.HeaderR=temail.Iteratorstemail.ErrorsRttypesRtstringRRRtImportErrort_lowertuppertMailmanRRR	tMailman.SafeDictR
tMailman.Logging.SyslogRthashlibtmd5tmd5_newtsha1R�tshatnewRRt	NameErrortdns.resolverRft
dns.rdatatypet
dns.exceptionRReR�RQR&RpR3tcompileRR1R5R!R#R5R8RBRERIRLRPRYR`R:RoRsRwt_vowelst_consonantsR�R�R}R'R�R�tMEMBER_PASSWORD_LENGTHR�R�R�R�R�R�R�R�R�R�t	ExceptionR�R�R�R�RRRRR�RRReR#R$R)R-R4R7R9R:RHRKRJRVt	_badwordsRR^R_R`R]RbR�(((s[/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Utils.pyt<module>s�
	

	





		K		
				


		!			
	o
	'										/						

Zerion Mini Shell 1.0