diff options
| author | Barry Warsaw | 2009-08-21 18:07:35 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-08-21 18:07:35 -0400 |
| commit | d1718e1a1cc289344d2a68c7430c492a4a7966b6 (patch) | |
| tree | d6b404e8544c83de5a3516a8206c7da92d9d088f /src/mailman/queue | |
| parent | da566eb047608ed2e65c71dd25979f01c825c843 (diff) | |
| download | mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.tar.gz mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.tar.zst mailman-d1718e1a1cc289344d2a68c7430c492a4a7966b6.zip | |
Diffstat (limited to 'src/mailman/queue')
| -rw-r--r-- | src/mailman/queue/__init__.py | 3 | ||||
| -rw-r--r-- | src/mailman/queue/docs/news.txt | 6 | ||||
| -rw-r--r-- | src/mailman/queue/docs/runner.txt | 4 | ||||
| -rw-r--r-- | src/mailman/queue/lmtp.py | 3 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/mailman/queue/__init__.py b/src/mailman/queue/__init__.py index ae3666643..a6ceb6bb2 100644 --- a/src/mailman/queue/__init__.py +++ b/src/mailman/queue/__init__.py @@ -52,6 +52,7 @@ from zope.interface import implements from mailman import i18n from mailman.config import config from mailman.email.message import Message +from mailman.interfaces.listmanager import IListManager from mailman.interfaces.runner import IRunner from mailman.interfaces.switchboard import ISwitchboard from mailman.utilities.filesystem import makedirs @@ -417,7 +418,7 @@ class Runner: # # Find out which mailing list this message is destined for. listname = unicode(msgdata.get('listname')) - mlist = config.db.list_manager.get(listname) + mlist = IListManager(config).get(listname) if mlist is None: elog.error('Dequeuing message destined for missing list: %s', listname) diff --git a/src/mailman/queue/docs/news.txt b/src/mailman/queue/docs/news.txt index c9f2417a0..a0535babc 100644 --- a/src/mailman/queue/docs/news.txt +++ b/src/mailman/queue/docs/news.txt @@ -7,8 +7,8 @@ NNTP newsgroup. One of the most important things this runner does is prepare the message for Usenet (yes, I know that NNTP is not Usenet, but this runner was originally written to gate to Usenet, which has its own rules). - >>> from mailman.queue.news import prepare_message - >>> mlist = config.db.list_manager.create('_xtest@example.com') + >>> from mailman.app.lifecycle import create_list + >>> mlist = create_list('_xtest@example.com') >>> mlist.linked_newsgroup = 'comp.lang.python' Some NNTP servers such as INN reject messages containing a set of prohibited @@ -33,6 +33,8 @@ prohibited headers. ... A message ... """) >>> msgdata = {} + + >>> from mailman.queue.news import prepare_message >>> prepare_message(mlist, msg, msgdata) >>> msgdata['prepped'] True diff --git a/src/mailman/queue/docs/runner.txt b/src/mailman/queue/docs/runner.txt index 032ea4c50..2c07f30ca 100644 --- a/src/mailman/queue/docs/runner.txt +++ b/src/mailman/queue/docs/runner.txt @@ -15,8 +15,8 @@ The basic architecture of qrunner is implemented in the base class that all runners inherit from. This base class implements a .run() method that runs continuously in a loop until the .stop() method is called. - >>> mlist = config.db.list_manager.create('_xtest@example.com') - >>> mlist.preferred_language = 'en' + >>> from mailman.app.lifecycle import create_list + >>> mlist = create_list('_xtest@example.com') Here is a very simple derived qrunner class. Queue runners use a configuration section in the configuration files to determine run diff --git a/src/mailman/queue/lmtp.py b/src/mailman/queue/lmtp.py index 00c9ad988..a198f8850 100644 --- a/src/mailman/queue/lmtp.py +++ b/src/mailman/queue/lmtp.py @@ -41,6 +41,7 @@ from email.utils import parseaddr from mailman.config import config from mailman.database.transaction import txn from mailman.email.message import Message +from mailman.interfaces.listmanager import IListManager from mailman.queue import Runner elog = logging.getLogger('mailman.error') @@ -133,7 +134,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(config.db.list_manager.names) + listnames = set(IListManager(config).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. |
