summaryrefslogtreecommitdiff
path: root/src/mailman/queue
diff options
context:
space:
mode:
authorBarry Warsaw2009-08-26 02:27:37 -0400
committerBarry Warsaw2009-08-26 02:27:37 -0400
commit9ad8c1e5524bc9479fd356757016ec160f392dd7 (patch)
tree2e8f5aab9ed6d9c52f03ae355dbed080602ee5b1 /src/mailman/queue
parent0ce2f82735911c738349b1812c86e09355ecee60 (diff)
downloadmailman-9ad8c1e5524bc9479fd356757016ec160f392dd7.tar.gz
mailman-9ad8c1e5524bc9479fd356757016ec160f392dd7.tar.zst
mailman-9ad8c1e5524bc9479fd356757016ec160f392dd7.zip
Instead of using an adapter, use a utility to get the mailing list manager.
Diffstat (limited to 'src/mailman/queue')
-rw-r--r--src/mailman/queue/__init__.py3
-rw-r--r--src/mailman/queue/lmtp.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/mailman/queue/__init__.py b/src/mailman/queue/__init__.py
index a6ceb6bb2..f3a0b04e9 100644
--- a/src/mailman/queue/__init__.py
+++ b/src/mailman/queue/__init__.py
@@ -47,6 +47,7 @@ import traceback
from cStringIO import StringIO
from lazr.config import as_boolean, as_timedelta
+from zope.component import getUtility
from zope.interface import implements
from mailman import i18n
@@ -418,7 +419,7 @@ class Runner:
#
# Find out which mailing list this message is destined for.
listname = unicode(msgdata.get('listname'))
- mlist = IListManager(config).get(listname)
+ mlist = getUtility(IListManager).get(listname)
if mlist is None:
elog.error('Dequeuing message destined for missing list: %s',
listname)
diff --git a/src/mailman/queue/lmtp.py b/src/mailman/queue/lmtp.py
index a198f8850..c07594c0e 100644
--- a/src/mailman/queue/lmtp.py
+++ b/src/mailman/queue/lmtp.py
@@ -37,6 +37,7 @@ import logging
import asyncore
from email.utils import parseaddr
+from zope.component import getUtility
from mailman.config import config
from mailman.database.transaction import txn
@@ -134,7 +135,7 @@ class LMTPRunner(Runner, smtpd.SMTPServer):
try:
# Refresh the list of list names every time we process a message
# since the set of mailing lists could have changed.
- listnames = set(IListManager(config).names)
+ listnames = set(getUtility(IListManager).names)
qlog.debug('listnames: %s', listnames)
# Parse the message data. If there are any defects in the
# message, reject it right away; it's probably spam.