Viewing File: /usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pyc


*hc@sVdZddlmZddlmZddlmZdZdefdYZdS(	s5GUI component managing the content filtering options.i(tmm_cfg(t_(tGUIBases
t
ContentFiltercBs/eZdZddZdZdZRS(cCsdtdfS(Nt
contentfiltersContent filtering(R(tself((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pytGetConfigCategoryscCs|dkrdStj}tdtdtdg}tjrY|jtdntddtjtdtd	fd
tdfdtjd
|fd
tdtdfdtjd
|fd
tdtdfdtjd
|fd
tdfdtjd
|fd
tdfdtjtdtd	fd
tdfdtjtdtd	fd
tdfdtjt|d
tdtdfg	S(NRtDiscardtRejectsForward to List OwnertPreserves>Policies concerning the content of list traffic.

            <p>Content filtering works like this: when a message is
            received by the list and you have enabled content filtering, the
            individual attachments are first compared to the
            <a href="?VARHELP=contentfilter/filter_mime_types">filter
            types</a>.  If the attachment type matches an entry in the filter
            types, it is discarded.

            <p>Then, if there are <a
            href="?VARHELP=contentfilter/pass_mime_types">pass types</a>
            defined, any attachment type that does <em>not</em> match a
            pass type is also discarded.  If there are no pass types defined,
            this check is skipped.

            <p>After this initial filtering, any <tt>multipart</tt>
            attachments that are empty are removed.  If the outer message is
            left empty after this filtering, then the whole message is
            discarded.

            <p> Then, each <tt>multipart/alternative</tt> section will
            be replaced by just the first alternative that is non-empty after
            filtering if
            <a href="?VARHELP=contentfilter/collapse_alternatives"
            >collapse_alternatives</a> is enabled.

            <p>Finally, any <tt>text/html</tt> parts that are left in the
            message may be converted to <tt>text/plain</tt> if
            <a href="?VARHELP=contentfilter/convert_html_to_plaintext"
            >convert_html_to_plaintext</a> is enabled and the site is
            configured to allow these conversions.tfilter_contenttNotYesis_Should Mailman filter the content of list traffic according
             to the settings below?tfilter_mime_typesi
sJRemove message attachments that have a matching content
             type.sUse this option to remove each message attachment that
             matches one of these content types.  Each line should contain a
             string naming a MIME <tt>type/subtype</tt>,
             e.g. <tt>image/gif</tt>.  Leave off the subtype to remove all
             parts with a matching major content type, e.g. <tt>image</tt>.

             <p>Blank lines are ignored.

             <p>See also <a href="?VARHELP=contentfilter/pass_mime_types"
             >pass_mime_types</a> for a content type whitelist.tpass_mime_typessRemove message attachments that don't have a matching
             content type.  Leave this field blank to skip this filter
             test.sUse this option to remove each message attachment that does
             not have a matching content type.  Requirements and formats are
             exactly like <a href="?VARHELP=contentfilter/filter_mime_types"
             >filter_mime_types</a>.

             <p><b>Note:</b> if you add entries to this list but don't add
             <tt>multipart</tt> to this list, any messages with attachments
             will be rejected by the pass filter.tfilter_filename_extensionssPRemove message attachments that have a matching filename
             extension.tpass_filename_extensionssRemove message attachments that don't have a matching
             filename extension.  Leave this field blank to skip this filter
             test.tcollapse_alternativessUShould Mailman collapse multipart/alternative to its
             first part content?tconvert_html_to_plaintextsShould Mailman convert <tt>text/html</tt> parts to plain
             text?  This conversion happens after MIME attachments have been
             stripped.t
filter_actionsOAction to take when a message matches the content filtering
             rules.sKOne of these actions is taken when the message matches one of
             the content filtering rules, meaning, the top-level
             content type matches one of the <a
             href="?VARHELP=contentfilter/filter_mime_types"
             >filter_mime_types</a>, or the top-level content type does
             <strong>not</strong> match one of the
             <a href="?VARHELP=contentfilter/pass_mime_types"
             >pass_mime_types</a>, or if after filtering the subparts of the
             message, the message ends up empty.

             <p>Note this action is not taken if after filtering the message
             still contains content.  In that case the message is always
             forwarded on to the list membership.

             <p>When messages are discarded, a log entry is written
             containing the Message-ID of the discarded message.  When
             messages are rejected or forwarded to the list owner, a reason
             for the rejection is included in the bounce message to the
             original author.  When messages are preserved, they are saved in
             a special queue directory on disk for the site administrator to
             view (and possibly rescue) but otherwise discarded.  This last
             option is only available if enabled by the site
             administrator.(	tNoneRtTEXTFIELDWIDTHRt%OWNERS_CAN_PRESERVE_FILTERED_MESSAGEStappendtRadiotTextttuple(RtmlisttcategorytsubcattWIDTHtactions((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pyt
GetConfigInfo sL	!	!						!	!	cCs|d	krJg}xg|jD]}|j^q"D]}d}|jd}	|	dkro|rod}no|	dkrg|jdD]}|jj^q\}
}|
s|rd}qn|	dkrd}n|s|jtdq8|j|jjq8W|dkr/||_q|dkr||_	qn|d
krg}x@g|jD]}|j^qlD]}
|j|
jqW|dkr||_
q|dkr||_qntj
|||||dS(NR
Rit/is#Bad MIME type ignored: %(spectype)sRR(sfilter_mime_typesspass_mime_types(sfilter_filename_extensionsspass_filename_extensions(t
splitlineststriptcounttsplittlowertaddErrorRRR
RRRRt	_setValue(RRtpropertytvaltdocttypeststspectypetoktslashestmaintypetsubtypetfextstext((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pyR(s>,	1		,cCst|dkrtj|jS|dkr8tj|jS|dkrTtj|jS|dkrptj|jSdS(NR
RRR(tNLtjoinR
RRRR(RRtkindR)tparams((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pytgetValuesN(t__name__t
__module__RRR R(R9(((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pyRs	{	#N(	t__doc__tMailmanRtMailman.i18nRtMailman.Gui.GUIBaseRR5R(((s?/usr/local/cpanel/3rdparty/mailman/Mailman/Gui/ContentFilter.pyt<module>s

Back to Directory File Manager