aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Queue
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2008-04-26 17:56:17 -0700
committerMark Sapiro <mark@msapiro.net>2008-04-26 17:56:17 -0700
commit2a8b33178fe455cfb3cc5d821aa51cd41dfaa166 (patch)
treea87848bb6a12aff9b7b37143ea95b70f2cac9372 /Mailman/Queue
parent42c1166e311f610e70bc42530361b188242cda9d (diff)
downloadmailman2-2a8b33178fe455cfb3cc5d821aa51cd41dfaa166.tar.gz
mailman2-2a8b33178fe455cfb3cc5d821aa51cd41dfaa166.tar.xz
mailman2-2a8b33178fe455cfb3cc5d821aa51cd41dfaa166.zip
Made the preservation of unparseable messages conditional on
mm_cfg.QRUNNER_SAVE_BAD_MESSAGES. Changed the queue for preservation of undequeueable entries from 'shunt' to 'bad'.
Diffstat (limited to 'Mailman/Queue')
-rw-r--r--Mailman/Queue/Runner.py18
-rw-r--r--Mailman/Queue/Switchboard.py4
2 files changed, 14 insertions, 8 deletions
diff --git a/Mailman/Queue/Runner.py b/Mailman/Queue/Runner.py
index 1724f043..5902375b 100644
--- a/Mailman/Queue/Runner.py
+++ b/Mailman/Queue/Runner.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -103,12 +103,18 @@ class Runner:
# but other problems can occur in message parsing, e.g.
# ValueError, and exceptions can occur in unpickling too.
# We don't want the runner to die, so we just log and skip
- # this entry, but preserve it for analysis.
+ # this entry, but maybe preserve it for analysis.
self._log(e)
- syslog('error',
- 'Skipping and preserving unparseable message: %s',
- filebase)
- self._switchboard.finish(filebase, preserve=True)
+ if mm_cfg.QRUNNER_SAVE_BAD_MESSAGES:
+ syslog('error',
+ 'Skipping and preserving unparseable message: %s',
+ filebase)
+ preserve=True
+ else:
+ syslog('error',
+ 'Ignoring unparseable message: %s', filebase)
+ preserve=False
+ self._switchboard.finish(filebase, preserve=preserve)
continue
try:
self._onefile(msg, msgdata)
diff --git a/Mailman/Queue/Switchboard.py b/Mailman/Queue/Switchboard.py
index 7a0b770f..94b8efa0 100644
--- a/Mailman/Queue/Switchboard.py
+++ b/Mailman/Queue/Switchboard.py
@@ -169,13 +169,13 @@ class Switchboard:
bakfile = os.path.join(self.__whichq, filebase + '.bak')
try:
if preserve:
- psvfile = os.path.join(mm_cfg.SHUNTQUEUE_DIR, filebase + '.psv')
+ psvfile = os.path.join(mm_cfg.BADQUEUE_DIR, filebase + '.psv')
# Create the directory if it doesn't yet exist.
# Copied from __init__.
omask = os.umask(0) # rwxrws---
try:
try:
- os.mkdir(mm_cfg.SHUNTQUEUE_DIR, 0770)
+ os.mkdir(mm_cfg.BADQUEUE_DIR, 0770)
except OSError, e:
if e.errno <> errno.EEXIST: raise
finally: