summaryrefslogtreecommitdiff
path: root/mailman/queue/outgoing.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-01-06 19:55:59 -0500
committerBarry Warsaw2009-01-06 19:55:59 -0500
commit89f5f76ed31d6ca2faf8e2a783a37e9009b03413 (patch)
treef1023f64501a49917674f5bcd78927aa5cee08ef /mailman/queue/outgoing.py
parent37c255b7b0c1b8ea10c8d24a44c8586de86ffcc6 (diff)
downloadmailman-89f5f76ed31d6ca2faf8e2a783a37e9009b03413.tar.gz
mailman-89f5f76ed31d6ca2faf8e2a783a37e9009b03413.tar.zst
mailman-89f5f76ed31d6ca2faf8e2a783a37e9009b03413.zip
Diffstat (limited to 'mailman/queue/outgoing.py')
-rw-r--r--mailman/queue/outgoing.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mailman/queue/outgoing.py b/mailman/queue/outgoing.py
index ed648cca0..fdb1289fd 100644
--- a/mailman/queue/outgoing.py
+++ b/mailman/queue/outgoing.py
@@ -18,12 +18,13 @@
"""Outgoing queue runner."""
import os
+import sys
import socket
import logging
from datetime import datetime
+from lazr.config import as_timedelta
-from mailman import Defaults
from mailman.config import config
from mailman.core import errors
from mailman.queue import Runner
@@ -43,9 +44,10 @@ class OutgoingRunner(Runner, BounceMixin):
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[Defaults.DELIVERY_MODULE]
- self._func = handler.process
+ # We look this function up only at startup time.
+ module_name, callable_name = config.mta.outgoing.rsplit('.', 1)
+ __import__(module_name)
+ self._func = getattr(sys.modules[module_name], callable_name)
# 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.
@@ -112,7 +114,8 @@ class OutgoingRunner(Runner, BounceMixin):
return False
else:
# Keep trying to delivery this message for a while
- deliver_until = now + Defaults.DELIVERY_RETRY_PERIOD
+ deliver_until = now + as_timedelta(
+ config.mta.delivery_retry_period)
msgdata['last_recip_count'] = len(recips)
msgdata['deliver_until'] = deliver_until
msgdata['recips'] = recips