summaryrefslogtreecommitdiff
path: root/src/mailman/queue
diff options
context:
space:
mode:
authorBarry Warsaw2009-12-08 22:39:10 -0500
committerBarry Warsaw2009-12-08 22:39:10 -0500
commit3d65590999f5288307ecb0df6ae1b77241869f61 (patch)
tree7047453b1ddfbc6d5715834553f46e3362d3e1da /src/mailman/queue
parent24f92b6c842bfa3701cb708e4aee3c991f206c9d (diff)
downloadmailman-3d65590999f5288307ecb0df6ae1b77241869f61.tar.gz
mailman-3d65590999f5288307ecb0df6ae1b77241869f61.tar.zst
mailman-3d65590999f5288307ecb0df6ae1b77241869f61.zip
* Make IDomainManager a utility, since the config object is global.
* Give IMailingList a .domain attribute which looks up the IDomain for its .host_name. This cleans up a lot of code. * Add a test for the 'confirm' email command. * Suppress blank lines in email command responses. * Make the IDomainCollection a utility.
Diffstat (limited to 'src/mailman/queue')
-rw-r--r--src/mailman/queue/command.py12
-rw-r--r--src/mailman/queue/docs/command.txt5
2 files changed, 10 insertions, 7 deletions
diff --git a/src/mailman/queue/command.py b/src/mailman/queue/command.py
index f36f9a31d..d5ce708b1 100644
--- a/src/mailman/queue/command.py
+++ b/src/mailman/queue/command.py
@@ -183,14 +183,16 @@ class CommandRunner(Runner):
'Invalid status: %s' % status)
if status == ContinueProcessing.no:
break
- # All done, send the response.
- if len(finder.command_lines) > 0:
+ # All done. Strip blank lines and send the response.
+ lines = filter(None, (line.strip() for line in finder.command_lines))
+ if len(lines) > 0:
print >> results, _('\n- Unprocessed:')
- for line in finder.command_lines:
+ for line in lines:
print >> results, line
- if len(finder.ignored_lines) > 0:
+ lines = filter(None, (line.strip() for line in finder.ignored_lines))
+ if len(lines) > 0:
print >> results, _('\n- Ignored:')
- for line in finder.ignored_lines:
+ for line in lines:
print >> results, line
print >> results, _('\n- Done.')
# Send a reply, but do not attach the original message. This is a
diff --git a/src/mailman/queue/docs/command.txt b/src/mailman/queue/docs/command.txt
index 445bf2ab6..c63c323b4 100644
--- a/src/mailman/queue/docs/command.txt
+++ b/src/mailman/queue/docs/command.txt
@@ -137,7 +137,8 @@ address, and the other is the results of his email command.
>>> from mailman.interfaces.domain import IDomainManager
>>> from mailman.interfaces.registrar import IRegistrar
- >>> registrar = IRegistrar(IDomainManager(config)['example.com'])
+ >>> from zope.component import getUtility
+ >>> registrar = IRegistrar(getUtility(IDomainManager)['example.com'])
>>> for item in messages:
... subject = item.msg['subject']
... print 'Subject:', subject
@@ -210,7 +211,7 @@ The -confirm address is also available as an implicit command.
Message-ID: ...
<BLANKLINE>
- Results:
- Confirmed
+ Confirmation token did not match
<BLANKLINE>
- Done.
<BLANKLINE>