summaryrefslogtreecommitdiff
path: root/mailman/queue/docs
diff options
context:
space:
mode:
authorBarry Warsaw2008-03-12 18:35:16 -0400
committerBarry Warsaw2008-03-12 18:35:16 -0400
commit4e2070ca3d8bca288cbc2d96771a78c22a7ec031 (patch)
treef03b64e57aaf43bc78187c4d52955b8f2c569d03 /mailman/queue/docs
parent5ca899a81b547dd46197b8d51c7f51538ecde397 (diff)
downloadmailman-4e2070ca3d8bca288cbc2d96771a78c22a7ec031.tar.gz
mailman-4e2070ca3d8bca288cbc2d96771a78c22a7ec031.tar.zst
mailman-4e2070ca3d8bca288cbc2d96771a78c22a7ec031.zip
Add a working (though not yet complete) test for the LMTP runner.
Refactor the TestableMaster class so that doctests don't need to do all the threading and event fiddling themselves. Hide all that in the test class. In bin/master, add the -r/--runner option to allow overriding the set of queue runners to start from the command line. This is much more convenient than fiddling the config file (which is still supported), and it allows us to start a subset of the runners from the TestableMaster class. Refactor the calculation of queue runner shortcut names into Configuration.add_qrunner(). This way, it's easy to share between bin/qrunner and bin/master. Use pkg_resource in bin/testall to create the test configuration file. We're still using mailman.__file__ as the target to os.walk() though, so this conversion isn't complete. In bin/testall, update to the new convention of putting .options and .arguments on the parser instance, so we only need to pass back one thing. In test_documentation.py, use config.verbosity instead of config.options.verbosity. Wind that through to bin/testall while we're at it. Update loginit.py so that defaults for all the logging options can be found in a [*] section. This is better than [DEFAULT] because the latter requires %-interpolation and still requires each sublogger to be specified explicitly. Now we just set values in the [*] section and have them apply to all loggers. Allow for passing bin/testall's -v and -e options to any subprocesses that get created, e.g. via the TestableMaster. Now testall will write a logging.cfg file with a [*] entry as appropriate. It's DEFAULT_DATABASE_URL now, not SQLALCHEMY_ENGINE_URL. StockDatabase._reset() requires that the store be rolled back before it's reset. Otherwise if there are outstanding transactions, the reset will fail with an OperationalError. Update the LMTPRunner. Have it return a 501 error if the message has defects. Most defective messages are spam. Make the LMTPRunner startable and stoppable. Just because it's asyncore based doesn't mean that's not possible <wink>. Enable the LMTP runner in tests.
Diffstat (limited to 'mailman/queue/docs')
-rw-r--r--mailman/queue/docs/lmtp.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/mailman/queue/docs/lmtp.txt b/mailman/queue/docs/lmtp.txt
new file mode 100644
index 000000000..7c886c281
--- /dev/null
+++ b/mailman/queue/docs/lmtp.txt
@@ -0,0 +1,49 @@
+LTMP server
+===========
+
+Mailman can accept messages via LMTP (RFC 2033). Most modern mail servers
+support LMTP local delivery, so this is a very portable way to connect Mailman
+with your mail server.
+
+Our LMTP server is fairly simple though; all it does is make sure that the
+message is destined for a valid endpoint, e.g. mylist-join@example.com.
+
+Let's start a testable LMTP queue runner.
+
+ >>> from mailman.tests import helpers
+ >>> master = helpers.TestableMaster()
+ >>> master.start('lmtp')
+
+It also helps to have a nice LMTP client.
+
+ >>> lmtp = helpers.get_lmtp_client()
+ (220, '... Python LMTP queue runner 1.0')
+ >>> lmtp.lhlo('remote.example.org')
+ (250, ...)
+
+
+Invalid mailing list
+--------------------
+
+If the mail server tries to send a message to a non-existant mailing list, it
+will get a 550 error.
+
+ >>> lmtp.sendmail(
+ ... 'anne.person@example.com',
+ ... ['mylist@example.com'], """\
+ ... From: anne.person@example.com
+ ... To: mylist@example.com
+ ... Subject: An interesting message
+ ... Message-ID: <aardvark>
+ ...
+ ... This is an interesting message.
+ ... """)
+ Traceback (most recent call last):
+ ...
+ SMTPDataError: (550, 'Requested action not taken: mailbox unavailable')
+
+
+Clean up
+--------
+
+ >>> master.stop()