diff options
author | tkikuchi <> | 2004-10-03 06:00:32 +0000 |
---|---|---|
committer | tkikuchi <> | 2004-10-03 06:00:32 +0000 |
commit | 3b90e75081f508f9fcdf1764f83e6a416216e079 (patch) | |
tree | 6834a8a99f6e09ca1fd4499eacc81963163b8268 /Mailman/Gui/ContentFilter.py | |
parent | 56e41649e44be99ee7c6ac5a0421adad3d67df12 (diff) | |
download | mailman2-3b90e75081f508f9fcdf1764f83e6a416216e079.tar.gz mailman2-3b90e75081f508f9fcdf1764f83e6a416216e079.tar.xz mailman2-3b90e75081f508f9fcdf1764f83e6a416216e079.zip |
Merging SF patches:
[ 904850 ] Scrubber in regular delivery per list
[ 1027882 ] filter attachments by filename extensions
and a patch in mailman-dev mailing list
http://mail.python.org/pipermail/mailman-developers/2004-September/017246.html
Diffstat (limited to 'Mailman/Gui/ContentFilter.py')
-rw-r--r-- | Mailman/Gui/ContentFilter.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Mailman/Gui/ContentFilter.py b/Mailman/Gui/ContentFilter.py index cb7ed95c..d681d6df 100644 --- a/Mailman/Gui/ContentFilter.py +++ b/Mailman/Gui/ContentFilter.py @@ -100,6 +100,15 @@ class ContentFilter(GUIBase): <tt>multipart</tt> to this list, any messages with attachments will be rejected by the pass filter.""")), + ('filter_filename_extensions', mm_cfg.Text, (10, WIDTH), 0, + _("""Remove message attachments that have a matching filename + extension."""),), + + ('pass_filename_extensions', mm_cfg.Text, (10, WIDTH), 0, + _("""Remove message attachments that don't have a matching + filename extension. Leave this field blank to skip this filter + test."""),), + ('convert_html_to_plaintext', mm_cfg.Radio, (_('No'), _('Yes')), 0, _("""Should Mailman convert <tt>text/html</tt> parts to plain text? This conversion happens after MIME attachments have been @@ -158,6 +167,15 @@ class ContentFilter(GUIBase): mlist.filter_mime_types = types elif property == 'pass_mime_types': mlist.pass_mime_types = types + elif property in ('filter_filename_extensions', + 'pass_filename_extensions'): + fexts = [] + for ext in [s.strip() for s in val.splitlines()]: + fexts.append(ext.lower()) + if property == 'filter_filename_extensions': + mlist.filter_filename_extensions = fexts + elif property == 'pass_filename_extensions': + mlist.pass_filename_extensions = fexts else: GUIBase._setValue(self, mlist, property, val, doc) @@ -166,4 +184,8 @@ class ContentFilter(GUIBase): return NL.join(mlist.filter_mime_types) if property == 'pass_mime_types': return NL.join(mlist.pass_mime_types) + if property == 'filter_filename_extensions': + return NL.join(mlist.filter_filename_extensions) + if property == 'pass_filename_extensions': + return NL.join(mlist.pass_filename_extensions) return None |