summaryrefslogtreecommitdiff
path: root/mailman/testing
diff options
context:
space:
mode:
Diffstat (limited to 'mailman/testing')
-rw-r--r--mailman/testing/helpers.py6
-rw-r--r--mailman/testing/smtplistener.py6
-rw-r--r--mailman/testing/testing.cfg.in5
3 files changed, 13 insertions, 4 deletions
diff --git a/mailman/testing/helpers.py b/mailman/testing/helpers.py
index af687828f..706ef603f 100644
--- a/mailman/testing/helpers.py
+++ b/mailman/testing/helpers.py
@@ -162,7 +162,7 @@ class SMTPServer:
"""An smtp server for testing."""
host = 'localhost'
- port = 9025
+ port = 10825
def __init__(self):
self._messages = []
@@ -174,6 +174,10 @@ class SMTPServer:
"""Start the smtp server in a thread."""
log.info('test SMTP server starting')
self._thread.start()
+ smtpd = smtplib.SMTP()
+ smtpd.connect(self.host, self.port)
+ smtpd.helo('test.localhost')
+ smtpd.quit()
def stop(self):
"""Stop the smtp server."""
diff --git a/mailman/testing/smtplistener.py b/mailman/testing/smtplistener.py
index 1dc11e3e0..eaf9083e8 100644
--- a/mailman/testing/smtplistener.py
+++ b/mailman/testing/smtplistener.py
@@ -58,12 +58,13 @@ class Server(smtpd.SMTPServer):
def __init__(self, localaddr, queue):
smtpd.SMTPServer.__init__(self, localaddr, None)
+ log.info('[SMTPServer] listening: %s', localaddr)
self._queue = queue
def handle_accept(self):
"""Handle connections by creating our own Channel object."""
conn, addr = self.accept()
- log.info('accepted: %s', addr)
+ log.info('[SMTPServer] accepted: %s', addr)
Channel(self, conn, addr)
def process_message(self, peer, mailfrom, rcpttos, data):
@@ -72,7 +73,8 @@ class Server(smtpd.SMTPServer):
message['X-Peer'] = '%s:%s' % peer
message['X-MailFrom'] = mailfrom
message['X-RcptTo'] = COMMASPACE.join(rcpttos)
- log.info('processed message: %s', message.get('message-id', 'n/a'))
+ log.info('[SMTPServer] processed message: %s',
+ message.get('message-id', 'n/a'))
self._queue.put(message)
def start(self):
diff --git a/mailman/testing/testing.cfg.in b/mailman/testing/testing.cfg.in
index e7b23ac6d..c8e121079 100644
--- a/mailman/testing/testing.cfg.in
+++ b/mailman/testing/testing.cfg.in
@@ -4,11 +4,14 @@
# both the process running the tests and all sub-processes (e.g. qrunners)
# must share the same configuration file.
-SMTPPORT = 10825
MAX_RESTARTS = 1
MTA = None
USE_LMTP = Yes
+# Make sure these goes to fake domains.
+MAIL_ARCHIVE_BASEURL = 'http://go.mail-archive.dev/'
+MAIL_ARCHIVE_RECIPIENT = 'archive@mail-archive.dev'
+
add_domain('example.com', 'www.example.com')
# bin/testall will add additional runtime configuration variables here.