From 1ffa4c74935a56a3c5de736fab052e33e4ab3d38 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 26 Dec 2008 09:04:33 -0500 Subject: Down to only 27 test failures. More temporary config -> Defaults changes. More fixes to smtp_direct.py. Other queue runner fixes, including allowing make_testable_runner() to take an optional 'name' which overrides the default class-calculated name. --- mailman/queue/outgoing.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mailman/queue/outgoing.py') diff --git a/mailman/queue/outgoing.py b/mailman/queue/outgoing.py index 9eb287e6b..2043d8bc8 100644 --- a/mailman/queue/outgoing.py +++ b/mailman/queue/outgoing.py @@ -26,6 +26,7 @@ import logging from datetime import datetime +from mailman import Defaults from mailman import Message from mailman.config import config from mailman.core import errors @@ -41,19 +42,19 @@ log = logging.getLogger('mailman.error') class OutgoingRunner(Runner, BounceMixin): - QDIR = config.OUTQUEUE_DIR + """The outgoing queue runner.""" def __init__(self, slice=None, numslices=1): Runner.__init__(self, slice, numslices) BounceMixin.__init__(self) # We look this function up only at startup time - handler = config.handlers[config.DELIVERY_MODULE] + handler = config.handlers[Defaults.DELIVERY_MODULE] self._func = handler.process # This prevents smtp server connection problems from filling up the # error log. It gets reset if the message was successfully sent, and # set if there was a socket.error. self._logged = False - self._retryq = Switchboard(config.RETRYQUEUE_DIR) + self._retryq = config.switchboards['retry'] def _dispose(self, mlist, msg, msgdata): # See if we should retry delivery of this message again. @@ -73,13 +74,13 @@ class OutgoingRunner(Runner, BounceMixin): # There was a problem connecting to the SMTP server. Log this # once, but crank up our sleep time so we don't fill the error # log. - port = config.SMTPPORT + port = int(config.mta.port) if port == 0: port = 'smtp' # Log this just once. if not self._logged: log.error('Cannot connect to SMTP server %s on port %s', - config.SMTPHOST, port) + config.mta.host, port) self._logged = True return True except errors.SomeRecipientsFailed, e: @@ -115,7 +116,7 @@ class OutgoingRunner(Runner, BounceMixin): return False else: # Keep trying to delivery this message for a while - deliver_until = now + config.DELIVERY_RETRY_PERIOD + deliver_until = now + Defaults.DELIVERY_RETRY_PERIOD msgdata['last_recip_count'] = len(recips) msgdata['deliver_until'] = deliver_until msgdata['recips'] = recips -- cgit v1.2.3-70-g09d2