aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Gui
diff options
context:
space:
mode:
authortkikuchi <>2004-10-03 06:00:32 +0000
committertkikuchi <>2004-10-03 06:00:32 +0000
commit3b90e75081f508f9fcdf1764f83e6a416216e079 (patch)
tree6834a8a99f6e09ca1fd4499eacc81963163b8268 /Mailman/Gui
parent56e41649e44be99ee7c6ac5a0421adad3d67df12 (diff)
downloadmailman2-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')
-rw-r--r--Mailman/Gui/ContentFilter.py22
-rw-r--r--Mailman/Gui/NonDigest.py9
2 files changed, 31 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
diff --git a/Mailman/Gui/NonDigest.py b/Mailman/Gui/NonDigest.py
index b66c5c4f..6926632d 100644
--- a/Mailman/Gui/NonDigest.py
+++ b/Mailman/Gui/NonDigest.py
@@ -134,6 +134,15 @@ and footers:
_('''Text appended to the bottom of every immediately-delivery
message. ''') + headfoot + extra),
])
+
+ info.extend([
+ ('scrub_nondigest', mm_cfg.Toggle, (_('No'), _('Yes')), 0,
+ _('Scrub attachments of regular delivery message?'),
+ _('''When you scrub attachments, they are stored in archive
+ area and links are made in the message so that the member can
+ access via web browser. If you want the attachments totally
+ disappear, you can use content filter options.''')),
+ ])
return info
def _setValue(self, mlist, property, val, doc):