diff options
| author | Barry Warsaw | 2012-04-22 17:07:44 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-22 17:07:44 -0400 |
| commit | 1138b27d849d7c2032092891293579d4f39e5eca (patch) | |
| tree | 15d66036216dabbfe9181f483dad6d2a1a798f6f | |
| parent | 410123421733763fdc95f07197d581ebc9a5db0e (diff) | |
| download | mailman-1138b27d849d7c2032092891293579d4f39e5eca.tar.gz mailman-1138b27d849d7c2032092891293579d4f39e5eca.tar.zst mailman-1138b27d849d7c2032092891293579d4f39e5eca.zip | |
| -rw-r--r-- | src/mailman/runners/lmtp.py | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/mailman/runners/lmtp.py b/src/mailman/runners/lmtp.py index 249ab94c1..61db6b848 100644 --- a/src/mailman/runners/lmtp.py +++ b/src/mailman/runners/lmtp.py @@ -15,6 +15,9 @@ # You should have received a copy of the GNU General Public License along with # GNU Mailman. If not, see <http://www.gnu.org/licenses/>. +# XXX This module needs to be refactored to avoid direct access to the +# config.db global. + """Mailman LMTP runner (server). Most mail servers can be configured to deliver local messages via 'LMTP'[1]. @@ -31,6 +34,14 @@ so that the peer mail server can provide better diagnostics. http://www.faqs.org/rfcs/rfc2033.html """ +from __future__ import absolute_import, print_function, unicode_literals + +__metaclass__ = type +__all__ = [ + 'LMTPRunner', + ] + + import email import smtpd import logging @@ -80,15 +91,15 @@ SUBADDRESS_QUEUES = dict( ) DASH = '-' -CRLF = '\r\n' -ERR_451 = '451 Requested action aborted: error in processing' -ERR_501 = '501 Message has defects' -ERR_502 = '502 Error: command HELO not implemented' -ERR_550 = '550 Requested action not taken: mailbox unavailable' -ERR_550_MID = '550 No Message-ID header provided' +CRLF = b'\r\n' +ERR_451 = b'451 Requested action aborted: error in processing' +ERR_501 = b'501 Message has defects' +ERR_502 = b'502 Error: command HELO not implemented' +ERR_550 = b'550 Requested action not taken: mailbox unavailable' +ERR_550_MID = b'550 No Message-ID header provided' # XXX Blech -smtpd.__version__ = 'Python LMTP runner 1.0' +smtpd.__version__ = b'Python LMTP runner 1.0' @@ -228,7 +239,7 @@ class LMTPRunner(Runner, smtpd.SMTPServer): config.switchboards[queue].enqueue(msg, msgdata) slog.debug('%s subaddress: %s, queue: %s', message_id, canonical_subaddress, queue) - status.append('250 Ok') + status.append(b'250 Ok') except Exception: slog.exception('Queue detection: %s', msg['message-id']) config.db.abort() |
