%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/mailman/Mailman/
Upload File :
Create Path :
Current File : //lib/mailman/Mailman/Message.pyo

�
��ac@s{dZddlZddlmZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZddlmZddlmZd	Zejd
ej�Zegej�jd�D]Zee�^q��Zdejjfd
��YZdejjfd��YZdejjfd��YZdefd��YZdefd��YZdS(s�Standard Mailman message object.

This is a subclass of email.Message but provides a slightly extended interface
which is more convenient for use inside Mailman.
i����N(tStringIO(tCharset(tHeader(tListTypet
StringType(tmm_cfg(tUtilss, s([\d.]+)t.t	GeneratorcBs)eZdZeddd�Zd�ZRS(s�Generates output from a Message object tree, keeping signatures.

       Headers will by default _not_ be folded in attachments.
    iNicCs/tjjj||d|d|�||_dS(Ntmangle_from_tmaxheaderlen(temailRt__init__t!_Generator__children_maxheaderlen(tselftoutfpR	R
tchildren_maxheaderlen((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR3s
cCs|j||j|j|j�S(s7Clone this generator with maxheaderlen set for children(t	__class__t
_mangle_from_R
(Rtfp((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pytclone9s(t__name__t
__module__t__doc__tTrueRR(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR.scBs2eZdZeddd�Zd�Zd�ZRS(s�Generates output from a Message object tree, keeping signatures.

       Headers will by default _not_ be folded in attachments.
    iNicCs/tjjj||d|d|�||_dS(NR	R
(RRRR
(RRR	R
R((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyREs
cCs|j||j|j|j�S(s7Clone this generator with maxheaderlen set for children(RRR
(RR((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRKscCsrt�}|j|�}|j�}t|t�r^|j|jd�dt�|j�}n|jj	|�dS(Nitunixfrom(
RRtget_payloadt
isinstancetlisttflattentFalsetgetvaluet_fptwrite(Rtmsgtstgtpayload((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt_handle_messageQs	
(RRRRRRR&(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR@s
	tMessagecBskeZd�Zd�Zd�Zd	dd�Zdd	d�Zd	d�Ze	e
d�Ze	e
d�ZRS(
cCs t|_tjjj|�dS(N(tVERSIONt__version__RR'R(R((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRfs	cCs
|j�S(N(t__str__(R((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt__repr__lscCsA||_|jdd�}t|d<|tkr5dS|jd�sPd|_n|jd�skd|_ng}d}x�|jD]�\}}t|t	�rg}d}xN|j
D]C\}	}
t|
t�r�t|
�}
d}n|j
|	|
f�q�W|r||_
d}qn|j
||f�q�W|r=||_ndS(NR)it_charsett
_default_types
text/plaini(iii(t__dict__tgetR(thas_keytNoneR,R-t_headersRRt_chunksRRtappend(RtdtversiontheadersthchangedtktvtchunkstcchangedR#tcharset((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt__setstate__os4	
		icCs�tj}|dk	r|}n|r-d}nd}x�|D]{}||}|sVq:ndj|j��}tjj|g�}y|d\}}	Wntk
r�q:nX|	r:Pq:q:W|j	�}
|
r�|
j
�d}	nd}	|s�|	j�S|	S(	s�Return the address considered to be the author of the email.

        This can return either the From: header, the Sender: header or the
        envelope header (a.k.a. the unixfrom header).  The first non-empty
        header value found is returned.  However the search order is
        determined by the following:

        - If mm_cfg.USE_ENVELOPE_SENDER is true, then the search order is
          Sender:, From:, unixfrom

        - Otherwise, the search order is From:, Sender:, unixfrom

        The optional argument use_envelope, if given overrides the
        mm_cfg.USE_ENVELOPE_SENDER setting.  It should be set to either 0 or 1
        (don't use None since that indicates no-override).

        unixfrom should never be empty.  The return address is always
        lowercased, unless preserve_case is true.

        This method differs from get_senders() in that it returns one and only
        one address, and uses a different search order.
        tsendertfromtiiN(ssenderR@(R@ssender(RtUSE_ENVELOPE_SENDERR1tjoint
splitlinesRRtgetaddressest
IndexErrortget_unixfromtsplittlower(Rtuse_envelopet
preserve_casetsenderfirstR7thtfieldvaltaddrstrealnametaddressR((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt
get_sender�s2			



cCs2|dkrtj}ng}x�|D]�}|dkr�|j�pFd}y!|jd|j�df�Wq�tk
r}q�Xq%|j|�}|r%g|D]}dj|j	��^q�}|j
tjj
|��q%q%Wg}xG|D]?}	|	d}
|
dk	r|r|
j�}
n|j|
�q�W|S(sReturn a list of addresses representing the author of the email.

        The list will contain the following addresses (in order)
        depending on availability:

        1. From:
        2. unixfrom
        3. Reply-To:
        4. Sender:

        The return addresses are always lower cased, unless `preserve_case' is
        true.  Optional `headers' gives an alternative search order, with None
        meaning, search the unixfrom header.  Items in `headers' are field
        names without the trailing colon.
        RAiN(R1RtSENDER_HEADERSRGR4RHRFtget_allRCRDtextendRRRERI(RRKR7tpairsRMRNt	fieldvalstfvtauthorstpairRQ((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pytget_senders�s,
!
% 

cCsBy tjjj||�}|SWntttfk
r=|SXdS(s�Some MUA have bugs in RFC2231 filename encoding and cause
        Mailman to stop delivery in Scrubber.py (called from ToDigest.py).
        N(RR'tget_filenametUnicodeErrortLookupErrort
ValueError(Rtfailobjtfilename((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR\s
cCs8t�}t|d|�}|j|d|�|j�S(s�Return entire formatted message as a string using
        Mailman.Message.Generator.

        Operates like email.Message.Message.as_string, only
	using Mailman's Message.Generator class. Only the top headers will
        get folded.
        R	R(RRRR(RRR	RR$((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt	as_strings	cCs8t�}t|d|�}|j|d|�|j�S(s�Return entire formatted message as a string using
        Mailman.Message.Generator.

        Operates like email.Message.Message.as_string, only
	using Mailman's Message.Generator class. Only the top headers will
        get folded.
        R	R(RRRR(RRR	RR$((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRbs	N(RRRR+R>R1RRR[R\RRRb(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR'es			)@,tUserNotificationcBs5eZdZdddd�Zed�Zd�ZRS(s&Class for internally crafted messages.cCs�tj|�d}|dk	r7ttj|��}n|dk	rV|j||�n|dkrkd}nt||dddd�|d<||d<t|t	�r�t
j|�|d<||_n||d<|g|_dS(Ns(no subject)theader_nametSubjectterrorstreplacetFromtTo(
R'RR1RRt
GetCharSettset_payloadRRRt
COMMASPACERCtrecips(RtrecipR?tsubjectttexttlangR=((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR/s 
	


cKs�|jd�s%tj|�|d<n|jd�sPtjjdd�|d<n|jd�pb|srd|d	<n|j||�d
S(s|Sends the message by enqueuing it to the `virgin' queue.

        This is used for all internally crafted messages.
        s
message-ids
Message-IDtdatet	localtimeitDatet
precedencetbulkt
PrecedenceN(R0Rtunique_message_idRt
formatdatet_enqueue(Rtmlisttnoprecedencet_kws((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pytsendBs
cKsTddlm}|tj�}|j|d|j�d|jdddd|�dS(Ni����(tget_switchboardtlistnameRmt
nodecorateitreduced_list_headers(tMailman.Queue.sbcacheRRtVIRGINQUEUE_DIRtenqueuet
internal_nameRm(RR{R}Rtvirginq((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRzVs	N(RRRR1RRR~Rz(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRc,stOwnerNotificationcBs)eZdZdddd�Zd�ZRS(sBLike user notifications, but this message goes to the list owners.icCs�|j}|r#|j|j�ntj|jd�}|j}tj||||||�|d=|j	�|d<||_
dS(NtbouncesttoRi(townerRUt	moderatorRtget_site_emailt	host_nametpreferred_languageRcRt
GetOwnerEmailt_sender(RR{RoRpttomoderatorsRmR?Rq((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRgs
	c
Ks]ddlm}|tj�}|j|d|j�d|jddddd|j|�dS(	Ni����(RR�RmR�iR�t	envsender(R�RRR�R�R�RmR�(RR{R}RR�((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyRzus	N(RRRR1RRz(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyR�ds( Rtret	cStringIORRtemail.Generatort
email.Messagetemail.Utilst
email.CharsetRtemail.HeaderRttypesRRtMailmanRRRltmatchR)tmottupletgroupRHR#tintR(RR'RcR�(((s]/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Message.pyt<module>s&4%�8

Zerion Mini Shell 1.0