summaryrefslogtreecommitdiff
path: root/mailman/queue/archive.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-01-01 17:58:39 -0500
committerBarry Warsaw2009-01-01 17:58:39 -0500
commit1c285f110d8e98597453c6b4b69ea01163033547 (patch)
tree00c7ec16711b2073e40f593658f652726a9d4231 /mailman/queue/archive.py
parent12513c7d0fc1f5d2a1aabda349637309f6e8300b (diff)
parent600ddb503a391d70230d96ee91a631888d11b35a (diff)
downloadmailman-1c285f110d8e98597453c6b4b69ea01163033547.tar.gz
mailman-1c285f110d8e98597453c6b4b69ea01163033547.tar.zst
mailman-1c285f110d8e98597453c6b4b69ea01163033547.zip
Diffstat (limited to 'mailman/queue/archive.py')
-rw-r--r--mailman/queue/archive.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/mailman/queue/archive.py b/mailman/queue/archive.py
index 6dda70387..69ec46f4b 100644
--- a/mailman/queue/archive.py
+++ b/mailman/queue/archive.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 2000-2009 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
@@ -25,19 +25,22 @@ __all__ = [
import os
import time
+import logging
from datetime import datetime
from email.Utils import parsedate_tz, mktime_tz, formatdate
from locknix.lockfile import Lock
-from mailman.configuration import config
+from mailman import Defaults
from mailman.core.plugins import get_plugins
from mailman.queue import Runner
+log = logging.getLogger('mailman.error')
+
class ArchiveRunner(Runner):
- QDIR = config.ARCHQUEUE_DIR
+ """The archive runner."""
def _dispose(self, mlist, msg, msgdata):
# Support clobber_date, i.e. setting the date in the archive to the
@@ -48,9 +51,9 @@ class ArchiveRunner(Runner):
received_time = formatdate(msgdata['received_time'])
if not original_date:
clobber = True
- elif config.ARCHIVER_CLOBBER_DATE_POLICY == 1:
+ elif Defaults.ARCHIVER_CLOBBER_DATE_POLICY == 1:
clobber = True
- elif config.ARCHIVER_CLOBBER_DATE_POLICY == 2:
+ elif Defaults.ARCHIVER_CLOBBER_DATE_POLICY == 2:
# What's the timestamp on the original message?
timetup = parsedate_tz(original_date)
now = datetime.now()
@@ -60,7 +63,7 @@ class ArchiveRunner(Runner):
else:
utc_timestamp = datetime.fromtimestamp(mktime_tz(timetup))
clobber = (abs(now - utc_timestamp) >
- config.ARCHIVER_ALLOWABLE_SANE_DATE_SKEW)
+ Defaults.ARCHIVER_ALLOWABLE_SANE_DATE_SKEW)
except (ValueError, OverflowError):
# The likely cause of this is that the year in the Date: field
# is horribly incorrect, e.g. (from SF bug # 571634):
@@ -78,5 +81,10 @@ class ArchiveRunner(Runner):
# While a list archiving lock is acquired, archive the message.
with Lock(os.path.join(mlist.data_path, 'archive.lck')):
for archive_factory in get_plugins('mailman.archiver'):
- archive_factory().archive_message(mlist, msg)
-
+ # A problem in one archiver should not prevent any other
+ # archiver from running.
+ try:
+ archive = archive_factory()
+ archive.archive_message(mlist, msg)
+ except Exception:
+ log.exception('Broken archiver: %s' % archive.name)