Barry Warsaw pushed to branch master at mailman / Mailman
Commits: 91a91411 by Thomas Schneider at 2016-02-25T17:04:52-05:00 Add documentation on interfacing with qmail Signed-off-by: Thomas Schneider <qsu...@qsuscs.de> - - - - - a33cf789 by Barry Warsaw at 2016-02-25T17:05:26-05:00 Merge branch 'qsx/mailman-qsx/qmail' Closes !92 - - - - - 2 changed files: - + contrib/qmail-lmtp - src/mailman/docs/MTA.rst Changes: ===================================== contrib/qmail-lmtp ===================================== --- /dev/null +++ b/contrib/qmail-lmtp @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +# Written by Thomas Schneider <qsu...@qsuscs.de> +# This script is placed in public domain. If this is not applicable, consider +# it licensed under the CC-0: +# <https://creativecommons.org/publicdomain/zero/1.0/> + +try: + import smtplib + import sys + import os + + lmtp = smtplib.LMTP("localhost", int(sys.argv[1])) + + try: + lmtp.sendmail( + os.environ['SENDER'], + os.environ['EXT' + sys.argv[2]] + "@" + os.environ['HOST'], + sys.stdin.buffer.read() + ) + except smtplib.SMTPResponseException as e: + if 400 <= e.smtp_code < 500: + exit(111) + # otherwise, it's either a 5xx aka permanent error or something else + # is already b0rked, thus raise -> exit(100) -> have qmail return a + # 5xx error + else: + raise +except: + exit(100) ===================================== src/mailman/docs/MTA.rst ===================================== --- a/src/mailman/docs/MTA.rst +++ b/src/mailman/docs/MTA.rst @@ -297,6 +297,58 @@ with Exim configuration, you probably want to start with the chapter on .. _`how Exim receives and delivers mail`: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-how_exim_receives_and_delivers_mail.html +qmail +===== + +qmail_ is a MTA written by djb_ and, though old and not updated, still +bulletproof and occassionally in use. + +Mailman settings +---------------- + +Mostly defaults in mailman.cfg:: + + [mta] + # NullMTA is just implementing the interface and thus satisfying Mailman + # without doing anything fancy + incoming: mailman.mta.null.NullMTA + # Mailman should not be run as root. + # Use any convenient port > 1024. 8024 is a convention, but can be + # changed if there is a conflict with other software using that port. + lmtp_port: 8024 + +This will listen on localhost:8024 with LMTP and deliver outgoing +messages to localhost:25. See ``mailman/config/schema.cfg`` for more +information on these settings. + +qmail configuration +------------------- + +It is assumed that qmail is configured to use the ``.qmail*`` files in a user’s +home directory, however the instructions should easily be adaptable to other +qmail configurations. However, it is required that Mailman has a (sub)domain +respectively a namespace on its own. A helper script called ``qmail-lmtp`` is +needed and can be found in the ``contrib/`` directory of the Mailman source +tree and assumed to be on ``$PATH`` here. + +As qmail puts every namespace in the address, we have to filter it out again. +If your main domain is ``example.com`` and you assign ``lists.example.com`` to +the user ``mailman``, qmail will give you the destination address +``mailman-s...@lists.example.com`` while it should actually be +``s...@lists.example.com``. The second argument to ``qmail-lmtp`` defines +how many parts (separated by dashes) to filter out. The first argument +specifies the LMTP port of mailman. Long story short, as user mailman: +:: + + % chmod +t "$HOME" + % echo '|qmail-lmtp 1 8042' > .qmail # put appropriate values here + % ln -sf .qmail .qmail-default + % chmod -t "$HOME" + +.. _qmail: https://cr.yp.to/qmail.html +.. _djb: https://cr.yp.to + + Sendmail ======== View it on GitLab: https://gitlab.com/mailman/mailman/compare/6a8cbd3b1f3fb7f3806eadb131700091d32a31b4...a33cf78968fd73651054b0159f92e21a0aa6da61
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org