diff options
| author | Joanna Skrzeszewska | 2013-09-08 07:22:32 +0000 |
|---|---|---|
| committer | Joanna Skrzeszewska | 2013-09-08 07:22:32 +0000 |
| commit | c7f8019ff5967a4f65d831ba77188435ed575b83 (patch) | |
| tree | 718ae46526a8b67d391bc98052fe4a70c92ff431 /src/mailman/runners/archive.py | |
| parent | 442037b1374ccb2821a48a7ea7606f137ce28241 (diff) | |
| download | mailman-c7f8019ff5967a4f65d831ba77188435ed575b83.tar.gz mailman-c7f8019ff5967a4f65d831ba77188435ed575b83.tar.zst mailman-c7f8019ff5967a4f65d831ba77188435ed575b83.zip | |
Diffstat (limited to 'src/mailman/runners/archive.py')
| -rw-r--r-- | src/mailman/runners/archive.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mailman/runners/archive.py b/src/mailman/runners/archive.py index f18bd7c61..9eb1dd0a2 100644 --- a/src/mailman/runners/archive.py +++ b/src/mailman/runners/archive.py @@ -36,6 +36,7 @@ from mailman.config import config from mailman.core.runner import Runner from mailman.interfaces.archiver import ClobberDate from mailman.utilities.datetime import RFC822_DATE_FMT, now +from mailman.model.mailinglist import ListArchiverSet log = logging.getLogger('mailman.error') @@ -91,17 +92,19 @@ class ArchiveRunner(Runner): def _dispose(self, mlist, msg, msgdata): received_time = msgdata.get('received_time', now(strip_tzinfo=False)) for archiver in config.archivers: - msg_copy = copy.deepcopy(msg) - if _should_clobber(msg, msgdata, archiver.name): - original_date = msg_copy['date'] - del msg_copy['date'] - del msg_copy['x-original-date'] - msg_copy['Date'] = received_time.strftime(RFC822_DATE_FMT) - if original_date: - msg_copy['X-Original-Date'] = original_date - # A problem in one archiver should not prevent other archivers - # from running. - try: - archiver.archive_message(mlist, msg_copy) - except Exception: - log.exception('Broken archiver: %s' % archiver.name) + archSet = ListArchiverSet(mlist) + if archSet.isEnabled(archiver.name): + msg_copy = copy.deepcopy(msg) + if _should_clobber(msg, msgdata, archiver.name): + original_date = msg_copy['date'] + del msg_copy['date'] + del msg_copy['x-original-date'] + msg_copy['Date'] = received_time.strftime(RFC822_DATE_FMT) + if original_date: + msg_copy['X-Original-Date'] = original_date + # A problem in one archiver should not prevent other archivers + # from running. + try: + archiver.archive_message(mlist, msg_copy) + except Exception: + log.exception('Broken archiver: %s' % archiver.name) |
