diff options
| author | Barry Warsaw | 2008-12-25 23:57:07 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-12-25 23:57:07 -0500 |
| commit | b8e68e7577aa12e0e355aabe2845981f0d73e3b5 (patch) | |
| tree | 4d988c8de9e29b080ac258d0bc1e4eee8e5ee32b /mailman/pipeline/scrubber.py | |
| parent | d4de7996e6d4fb5db04dfed3b3fd12747622b164 (diff) | |
| download | mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.tar.gz mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.tar.zst mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.zip | |
Added a buildout hack for zope.testing so that we can add our own command line
options to bin/test.
More test repair, even though it's cheating. Use a bunch of variables from
Defaults.py even though these will have to be moved to the schema.cfg.
Update logging initialization to consult the propagate flag from the command
line. Also skip mailman.root since this is not a valid logger.
Diffstat (limited to 'mailman/pipeline/scrubber.py')
| -rw-r--r-- | mailman/pipeline/scrubber.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mailman/pipeline/scrubber.py b/mailman/pipeline/scrubber.py index abc904613..e8268f0cf 100644 --- a/mailman/pipeline/scrubber.py +++ b/mailman/pipeline/scrubber.py @@ -38,8 +38,8 @@ from locknix.lockfile import Lock from mimetypes import guess_all_extensions from zope.interface import implements +from mailman import Defaults from mailman import Utils -from mailman.config import config from mailman.core.errors import DiscardMessage from mailman.core.plugins import get_plugin from mailman.i18n import _ @@ -158,7 +158,7 @@ def replace_payload_by_text(msg, text, charset): def process(mlist, msg, msgdata=None): - sanitize = config.ARCHIVE_HTML_SANITIZER + sanitize = Defaults.ARCHIVE_HTML_SANITIZER outer = True if msgdata is None: msgdata = {} @@ -394,7 +394,7 @@ def makedirs(dir): def save_attachment(mlist, msg, dir, filter_html=True): - fsdir = os.path.join(config.PRIVATE_ARCHIVE_FILE_DIR, + fsdir = os.path.join(Defaults.PRIVATE_ARCHIVE_FILE_DIR, mlist.fqdn_listname, dir) makedirs(fsdir) # Figure out the attachment type and get the decoded data @@ -409,7 +409,7 @@ def save_attachment(mlist, msg, dir, filter_html=True): filename, fnext = os.path.splitext(filename) # For safety, we should confirm this is valid ext for content-type # but we can use fnext if we introduce fnext filtering - if config.SCRUBBER_USE_ATTACHMENT_FILENAME_EXTENSION: + if Defaults.SCRUBBER_USE_ATTACHMENT_FILENAME_EXTENSION: # HTML message doesn't have filename :-( ext = fnext or guess_extension(ctype, fnext) else: @@ -430,7 +430,7 @@ def save_attachment(mlist, msg, dir, filter_html=True): with Lock(os.path.join(fsdir, 'attachments.lock')): # Now base the filename on what's in the attachment, uniquifying it if # necessary. - if not filename or config.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME: + if not filename or Defaults.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME: filebase = 'attachment' else: # Sanitize the filename given in the message headers @@ -475,7 +475,7 @@ def save_attachment(mlist, msg, dir, filter_html=True): try: fp.write(decodedpayload) fp.close() - cmd = config.ARCHIVE_HTML_SANITIZER % {'filename' : tmppath} + cmd = Defaults.ARCHIVE_HTML_SANITIZER % {'filename' : tmppath} progfp = os.popen(cmd, 'r') decodedpayload = progfp.read() status = progfp.close() |
